UNPKG

@mirari/mp-common

Version:

小程序公共库

46 lines (44 loc) 950 B
Component({ externalClasses: ['modal-content-class', 'modal-close-class'], 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) } } } })