canvasToTempFilePath:fail:canvasId do not exist" ?
发布于 6 年前 作者 xiulanzhong 3849 次浏览 来自 官方Issues

开发者工具调用 没啥反应  真机调试 就报错

canvasId 找不到

用的是 taro 框架

代码

Taro.canvasToTempFilePath({

      quality: .8,

      fileType: ‘jpg’,

      canvasId: ‘mycanvas’,

      success: res => {

        console.log(‘canvasToTempFilePathsuccess’res)

        this.setState({

          tempFilePath: res.tempFilePath

        })

      },

      fail: res => {

        console.log(‘canvasToTempFilePathfail’res)

      },

      complete: a => {

        console.log(‘aaa’a)

      }

    }, this)

html

<Canvas style={`width: ${width}px; height: ${height}px;`} className=‘huabu’ canvasId=‘mycanvas’ />

1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

另外可以了解一下新的canvas:https://developers.weixin.qq.com/community/develop/doc/00020a02c2c040114d19a398f5b001?blockType=1

回到顶部