收藏
回答

如何解决canvas.requestAnimationFrame()报错问题?

 touchEnd(e){//TODO:复位
      if(this._pointCountInScreenLessThanFive(tempSeat)){
        let boxModel = this._getBoxModel(tempSeat)
        let direction = this._computeRestDirection(boxModel) 
        this._reset(direction)
      }
    },
 _reset(direction){
      if(this._pointCountInScreenLessThanFive(tempSeat)){
        this._updata(tempSeat,direction)
        this._render(tempSeat,{})
        this.canvas.requestAnimationFrame(this._reset)
      }
    },
VM6312 WAService.js:2 MiniProgramError
Cannot read property '_pointCountInScreenLessThanFive' of undefined
TypeError: Cannot read property '_pointCountInScreenLessThanFive' of undefined
    at _reset (http://127.0.0.1:57867/appservice/components/seatMap/index.js:414:16)

tempSeat是在当前页面下模拟的全局变量,试验用

如蒙赐教,感激不尽!

回答关注问题邀请回答
收藏
登录 后发表内容
问题标签