在做項目時給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刪除。