在做项目时给button添加click事件,发现没反应,但另外写了一个button添加同样的事件,却能触发。
原因是使用了better-scroll,默认它会阻止touch事件。所以在配置中需要加上click: true
例:
mounted(){
this.scroll=new Bscroll(this.$refs.wrapper, { mouseWheel: true, click: true, tap: true })
}
在做项目时给button添加click事件,发现没反应,但另外写了一个button添加同样的事件,却能触发。
原因是使用了better-scroll,默认它会阻止touch事件。所以在配置中需要加上click: true
例:
mounted(){
this.scroll=new Bscroll(this.$refs.wrapper, { mouseWheel: true, click: true, tap: true })
}