import BScroll from 'better-scroll';
const ERR_OK= 0;
export default{
data(){
return{
goods:[]
}
},
porps: {
seller:{
type:Object
}
},
created(){
this.$http.get('/api/goods').then((res)=>{
res=res.body;
if(res.errno===ERR_OK){
this.goods=res.data;
this.$nextTick(() => {
this._initScroll();
})
}
},(res)=>{
})
this.classMap=['decrease','discount','invoice','guarantee','special'];
},
methods:{
_initScroll(){
this.leftScroll= new BScroll(this.$refs.goodsLeft,{});
this.rightScroll= new BScroll(this.$refs.goodsRight,{});
}
}
}
这个警告是由于谷哥不支持在用touchstart事件时用event.preventDefault();阻止默认行为,谷哥建议用css替代阻止默认行为,在拖动时不想页面发生滚动就在不想滚动的地方加上css,touch-action: none;而better-scroll可能是用了event.preventDefault();来阻止body滚动所以有此警告