好久没用uniapp了,导入完want Weapp后,我把want Weapp的Dialog代码复制粘贴过来
<van-dialog use-slot title="标题"
:show="show"
show-cancel-button
confirm-button-open-type="getUserInfo"
bind:close="onClose"
bing:getuserinfo="getUserInfo">
<image src="https://img.yzcdn.cn/1.jpg" />
</van-dialog>
然后再粘贴方法
data() {
return {
//控制弹窗
show: false
};
},
methods: {
//弹窗的点击确定
getUserInfo(event) {
console.log('确定')
},
//弹窗的关闭
onClose() {
this.show = false
console.log('关闭')
}
}
显示这个
ponent "pages/cate/cate" does not have a method "onClose