"canvasToTempFilePath: fail canvas is empty"?
发布于 5 年前 作者 btang 12366 次浏览 来自 问答

<ec-canvas id="mychartcanvas-id="myCanvasec="{{ ec }}force-use-old-canvas="true"></ec-canvas>

canvasId是有的,t第二个参数this,也有,wx.canvasToTempFilePath()调用就报错,报错信息:"canvasToTempFilePath: fail canvas is empty",求指点

setTimeout(() => {

      console.log('this=====',this)

wx.canvasToTempFilePath({

        canvasId: 'myCanvas',

        width:'200',

        height:'300',

        success: (res) => {

          console.log("res",res)

        },

        fail: (err) => {

          console.log("err",err)

        },

      }, this)

    }, 2000)

回到顶部