在做项目时给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 }) }
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。