贴代码,如下:
canvasToImage () {
mpvue.canvasToTempFilePath({
x: 0,
y: 0,
canvasId: 'shareCanvas',
fileType: 'jpg',
quality: 1,
success: res => {
console.log(res)
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success (res) {
console.log(res)
showModal({
content: '图片已保存到相册,赶紧去朋友圈分享吧~'
})
}
})
}
})
}
啊哈。。自己画个白背景吧。。