// components/My_showModel/index.js Component({ /** * 组件的属性列表 */ properties: { isShow: { type: Boolean, value: false }, /* 标题 */ title: { type: String, value: "提示" }, /* 内容 */ content: { type: String }, /* 确定按钮 */ confirm: { type: String, value: "确定" }, /* 取消按钮 */ cancel: { type: String, value: "取消" }, /* 隐藏取消按钮 */ hideCancel: { type: Boolean, value: false }, /* 按钮回调 */ callBack: { type: Function }, /* 是否tabbar页面 */ ifTabBar: { type: Boolean, value: false } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { catchtouchmove() {}, butClick(e) { const { value } = e.target.dataset; if (value == undefined) return; this.setData({ isShow: false }); this.triggerEvent('callBack', value); }, } })