@mirari/mp-common
Version:
小程序公共库
45 lines (43 loc) • 885 B
JavaScript
Component({
properties: {
visible: {
type: Boolean,
value: false
},
maskClosable: {
type: Boolean,
value: false
},
showClose: {
type: Boolean,
value: true
},
submitFormMethod: {
type: String,
value: 'submitForm'
},
submitFormIdSwitch: {
type: Boolean,
value: true
}
},
data: {
},
methods: {
onModalClose(e) {
this.triggerEvent('close')
},
onButtonClose(e) {
if (this.data.submitFormIdSwitch) {
this.triggerEvent('close')
getApp().globalData[this.data.submitFormMethod](e.detail.formId).then(() => {
console.log('modal close submit formid succ')
}).catch((e) => {
console.error('modal close submit formid fail', e)
})
} else {
this.triggerEvent('close', e.detail)
}
}
}
})