Component({ /** * 组件的属性列表 */ properties: { show: { // 控制显示/隐藏 type: Boolean, value: false }, }, /** * 组件的方法列表 */ methods: { close() { this.triggerEvent('close'); }, cancel() { this.triggerEvent('cancel'); }, confirm() { // 触发confirm事件带数据 this.triggerEvent('confirm', {/*数据*/}); }, } })