use the better-scroll plug-in to achieve the effect of x-axis sliding.
refers to https://zhuanlan.zhihu.com/p/.
, which says that the data in the
list is often obtained asynchronously, so we need to initialize the better-scroll after
this code is the layout
< div slot=" content "class=" tips product_button wrapper "ref=" wrapper ">
<div class="scrool_content">
<checker v-model="checkedMembers" type="checkbox" default-item-class="demo1-item" @on-change="memberChange" selected-item-class="demo1-item-selected">
<checker-item v-for="item in members" @on-item-click="itemClick" :disabled="isTip" :key="item.personid" :value="item">
{{item.name}}
</checker-item>
</checker>
</div>
</div>
the effect of the layout above
better-scroll
created() {
requestData().then((res) => {
this.data = res.data
this.$nextTick(() => {
this.scroll = new Bscroll(this.$refs.wrapper, {})
})
})
}
,
ref="wrapper",better-scroll