overflow:hidden;//全局設(shè)置
overflow-x:scroll;//左右邊緣進(jìn)行裁剪
overflow-y:visible;//上下邊緣的裁剪
overflow-wrap:normal;//內(nèi)容超過指定容器邊界時是否進(jìn)行判斷
<view class='myscroll'>
<text class="{{flag==index?'active':''}}" bindtap="flagFun" wx:for="{{categorys}}" wx:key="index" data-flagindex='{{index}}'>{{item.name}}</text>
</view>
.myscroll{
white-space: nowrap;
padding: 0 12px;
width: 100%;
box-sizing:border-box;
overflow-x: scroll;
}
把scroll-view去掉使用view通過設(shè)置overflow-x:scroll;
就可以了,記得設(shè)置寬度為100%;