You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
581 B
35 lines
581 B
2 years ago
|
let tempReslove = () => {};
|
||
|
|
||
|
Component({
|
||
|
data: {
|
||
|
hidden: true,
|
||
|
showCancel: true,
|
||
|
title: "",
|
||
|
content: "",
|
||
|
confirmText: "确认",
|
||
|
cancelText: "取消"
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
show(opts) {
|
||
|
this.setData({
|
||
|
...opts,
|
||
|
hidden: false
|
||
|
});
|
||
|
return new Promise(reslove => {
|
||
|
tempReslove = reslove;
|
||
|
});
|
||
|
},
|
||
|
hide() {
|
||
|
this.setData({ hidden: true });
|
||
|
},
|
||
|
confirm() {
|
||
|
tempReslove(true);
|
||
|
},
|
||
|
cancel() {
|
||
|
tempReslove(false);
|
||
|
this.hide();
|
||
|
}
|
||
|
}
|
||
|
});
|