mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
37 lines
701 B
JavaScript
37 lines
701 B
JavaScript
Component({
|
|
externalClasses: ['mask-class', 'container-class'],
|
|
properties: {
|
|
actions: {
|
|
type: Array,
|
|
value: []
|
|
},
|
|
show: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
cancelWithMask: {
|
|
type: Boolean,
|
|
value: true
|
|
},
|
|
cancelText: {
|
|
type: String,
|
|
value: ''
|
|
}
|
|
},
|
|
methods: {
|
|
onMaskClick() {
|
|
if (this.data.cancelWithMask) {
|
|
this.cancelClick();
|
|
}
|
|
},
|
|
cancelClick() {
|
|
this.triggerEvent('cancel');
|
|
},
|
|
handleBtnClick({ currentTarget = {} }) {
|
|
const dataset = currentTarget.dataset || {};
|
|
const { index } = dataset;
|
|
this.triggerEvent('actionclick', { index });
|
|
}
|
|
}
|
|
});
|