小程序使用weui库的loading组件报错

图片描述

const app = getApp()

Page({
  data: {
    tips: '请稍后',
    show: true,
    animated: true
  },
  onShow() {
    this.timer = setInterval(() => {
      this.setData({
        show: !this.data.show
      })
    }, 2000)
  },
  onUnload() {
    clearInterval(this.timer)
  }
})
  我按着文档写的  报错了 求教  谢谢
阅读 2.2k
1 个回答

把调试基础库设置2.2.3以上,不然组件lifetimes不生效。
报错原因:animationInstance不能传到data里面。

推荐问题