使用了屏幕滚动插件better-scroll,发现没有生效,
反复百度和调试,原来要在created加入$nextTick,在里面去监听执行
如代码
created() {
this.classMap = ['decrease', 'discount', 'special', 'invoice', 'guarantee'];
this.$http.get('/api/goods').then((response) => {
response = response.body;
if (response.errno === ERR_OK) {
this.goods = response.data;
this.$nextTick(() => {
this._initScroll();
this._calculateHeight();
});
}
});
},