::-webkit-scrollbar { display: none; width: 0 !important; height: 0 !important; -webkit-appearance: none; background: transparent; }
<scroll-view scroll-x style="width: 100%;white-space: nowrap;"> <view v-for="(item,index) in tabBars" class="px-3 py-2 font-md" :key="index" :id="'tab'+index" :class="tabIndex===index?'text-main font-lg font-weight-bold':''" @tap="changeTab(index)" style="display: inline-block!important">{{item.name}}</view> </scroll-view>
导航栏外部样式宽度100%,不自动换行。选项卡样式为inline-block 并设为优先 !important