提交 c1f3b3a5 编写于 作者: 杜庆泉's avatar 杜庆泉

takesnapshot 不需要再手动转换类型

上级 b81f8530
......@@ -8,7 +8,7 @@
<button class="uni-btn" @click="changeViewStyle">
修改 view 宽高及背景色
</button>
<button class="uni-btn btn-TakeSnapshot" type="primary" @tap="takeSnapshotClick">
点击截图
</button>
......@@ -37,7 +37,7 @@
takeSnapshotClick() {
const view = uni.getElementById('snapshot-content')!
view.takeSnapshot({
success: function (res : TakeSnapshotSuccess) {
success: function (res) {
console.log(res.tempFilePath)
this.snapImage = res.tempFilePath
uni.showToast({
......@@ -45,14 +45,14 @@
icon: "none"
})
},
fail: function (res : TakeSnapshotFail) {
fail: function (res) {
console.log(res)
uni.showToast({
icon: 'error',
title: '截图失败'
})
}
} as TakeSnapshotOptions)
})
},
saveToAlbum(e : TouchEvent) {
// console.log(e.currentTarget!.getAttribute("src"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册