vue 移动端better-scroll 包裹的元素 绑定点击事件无效

在做一个列表的时候需要点击列表将列表信息输出,给<li>加个一个很简单的@click,可是没有反应。

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

mounted () {
    this.scroll = new BScroll(this.$refs.search, {mouseWheel: true, click: true, tap: true})
  }

猜你喜欢

转载自www.cnblogs.com/tutao1995/p/12067758.html