<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>
2 回答
弑天下
TA贡献1818条经验 获得超8个赞
display: inline-block;height: 0.88rem; line-height: 0.888rem;padding: 0 0.466667rem;
添加回答
举报
0/150
提交
取消