vue 移动端在div上绑定click事件 失效

时间:2019-02-21 13:57:26   收藏:0   阅读:1610

在.vue的文件中使用了better-scroll,在div标签上绑定click事件后,无效。

原因:使用了better-scroll,默认它会阻止touch事件。所以在配置中需要加上click: true 即可解决

mounted(){
            this.$nextTick(() => {
                let bscrollDom = this.$refs.bscroll;
                this.aBScroll = new BScroll(bscrollDom,{ mouseWheel: true, click: true, tap: true })
            })
        }

 

原文:https://www.cnblogs.com/javascripter/p/10411922.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!