Vue中引入了better-scroll后 页面上的点击事件不生效了

click

  • 类型:Boolean
  • 默认值:false
  • 作用:better-scroll 默认会阻止浏览器的原生 click 事件。当设置为 true,better-scroll 会派发一个 click 事件,我们会给派发的 event 参数加一个私有属性 _constructed,值为 true。
async getRatings() {
      const res = await this.$axios.get('/api/ratings.json');
      if (res.data) {
        this.ratings = res.data || [];
        this.loading = false;
        this.$nextTick(() => {
          this.scroll = new BScroll(this.$refs.ratingsRef, {
            click: true
          });
        });
      }
    },

配置click为true,点击事件即可生效