use the better-scroll
plug-in in vue
. Initialize the better-scroll object in the mounted function. The code is as follows:
mounted(){
var _this = this;
setTimeout(function(){
_this.scroll = new BScroll(_this.$refs.wrapper,{
click:true
});
// this.scroll
// this.scroll.minScrollY = 0;
// this.scroll.maxScrollY = 0;
console.log(this.scroll);
_this.scroll.minScrollY = 0;
_this.scroll.maxScrollY = _this.scroll.maxScrollY - 15;
},1)
}
it is found that there is no problem after switching to setTimeout, and vue-devtools is also the actual modified value. Isn"t the $nextTick function equivalent to a setTimeout?
Why?