Page({
onReady() {
this.createSelectorQuery()
.select("#target")
.node()
.exec(res => {
const node = res[0].node
node.takeSnapshot({
type: 'arraybuffer',
format: 'png',
success: (res) => {},
fail(res) {}
})
}) // 此处少添加了花括号和小括号
}
})
没错喔