We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我把这个改造成uni-app版本的,绘图成功了,但是会报Cannot read property 'xiaoying' of null,
saveImageToLocal () { const width = this.width; const height = this.height; wx.canvasToTempFilePath({ x: 0, y: 0, width, height, canvasId: 'canvasdrawer', complete: res => { if (res.errMsg === 'canvasToTempFilePath:ok') {
// 有这三行代码会报错:Cannot read property 'xiaoying' of null this.showCanvas = false; this.isPainting = false; this.tempFileList = []; // 有这三行代码会报错:Cannot read property 'xiaoying' of null this.$emit('getImage', {tempFilePath: res.tempFilePath, errMsg: 'canvasdrawer:ok'}) } else { this.$emit('getImage', {errMsg: 'canvasdrawer:fail'}) } } }, this) }
The text was updated successfully, but these errors were encountered:
老哥。咋解决的啊。我马上也要在uni-app里用这个。
Sorry, something went wrong.
除了配置白名单,和图片地址必须是https格式外,我稍微改造了下代码, 搬砖,照着大佬代码改做了一个uni-app版本的 https://github.com/zibuyu1/uni-app-weixin
感谢老哥。🙏🙏🙏
推荐这个canvas库 easy-canvas
No branches or pull requests
你好,我把这个改造成uni-app版本的,绘图成功了,但是会报Cannot read property 'xiaoying' of null,
saveImageToLocal () {
const width = this.width;
const height = this.height;
wx.canvasToTempFilePath({
x: 0,
y: 0,
width,
height,
canvasId: 'canvasdrawer',
complete: res => {
if (res.errMsg === 'canvasToTempFilePath:ok') {
The text was updated successfully, but these errors were encountered: