Component({ options: { // multipleSlots: true, // 在组件定义时的选项中启用多slot支持 }, /** * 组件的属性列表 */ properties: {}, /** * 组件的初始数据 */ data: {}, lifetimes: { attached() { (this as any).words = ''; }, }, /** * 组件的方法列表 */ methods: { onConfirm(e: WechatMiniprogram.Input) { let { value } = e.detail; // (this as any).words = value; value = value.replace(' ', ''); if (value.length > 0) { this.triggerEvent('onConfirm', { value }); } }, // onTap() { // this.triggerEvent('onTap', { words: (this as any).words }); // }, }, });