exportdefault{
name:"better_scroll",
data() {return{
currentIndex:0, //当前显示的下标
listHeight: [],
scrollY:0,
menuIndexChange:true};
},
created() {this.$nextTick(() =>{this._initScroll();this.personScroll();this.height();
});
},
mounted() {},
methods: {//横轴初始化
personScroll() {//动态设置宽度
let width = this.width();this.$refs.li1.style.width = width + "px";this.$nextTick(() =>{if (!this.scroll) {this.scroll = new BScroll(this.$refs.personWrap, {
startX:0,
click:true,
scrollX:true,
scrollY:false,
eventPassthrough:"vertical",
bounce:false});
}else{this.scroll.refresh();
}
});
},//新建滚动实例 并监听竖轴滚动的高度
_initScroll() {this.wrapperScroll = new BScroll(this.$refs.wrapper, {
cli