better-scroll 不能横向滚动,求助!

<div class="tab" ref="tab">

  <div class="tab_content">
      <div class="tab_item" v-for="(item,index) in menuList" :key="index">
          {{item.name}}
      </div>
  </div>

</div>

props: {
// 首页传过来的tab的值
menuList:null,
},

methods: {

  onScroll(){        this.$nextTick(()=>{            if (!this.scroll) {                this.scroll=new BScroll(this.$refs.tab, {
                    startX:0,
                    click:true,
                    scrollX:true,
                    scrollY:false,
                })
            }else{                this.scroll.refresh()
            }
        })
    }
},
 mounted () {  this.onScroll()
}
<style>

.tab{

width: 7.54rem;height: 0.88rem;background: #fff;overflow: hidden;

}
.tab_item{

display: inline-block;height: 0.88rem;
line-height: 0.888rem;padding: 0 0.466667rem;


</style>


撒科打诨
浏览 1426回答 2
2回答

弑天下

display:&nbsp;inline-block;height:&nbsp;0.88rem; line-height:&nbsp;0.888rem;padding:&nbsp;0&nbsp;0.466667rem;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript