// components/modal/modal.js Component({ /** * 组件的属性列表 */ properties: { title: { type: String, value: '标题' }, ModalType: { type: String, value: 'text' }, content: { type: String, value: '' }, btnText: { type: String, value: '确定' }, ShowModal: { type: Boolean, value: false } }, /** * 组件的初始数据 */ data: { Phone: '' }, /** * 组件的方法列表 */ methods: { saveFun: function (e) { if (this.properties.ModalType === 'input') { this.triggerEvent('click', this.data.Phone) } else { this.triggerEvent('click') } this.setData({Phone: ''}) }, inputPhone: function (e) { this.setData({ Phone: e.detail.value }) } } })