import dayjs from 'dayjs'; Component({ options: { addGlobalClass: true, }, /** * 组件的属性列表 */ properties: { result: { type: Object, value: { name: '', district: '', sceneType: '', }, observer(value) { this.setData({ item: value, ['item.updateTime']: dayjs(value.updateTime).format('YYYY-MM'), }); }, }, }, /** * 组件的初始数据 */ data: { item: {} }, /** * 组件的方法列表 */ methods: { handCellClick(e) { this.triggerEvent('click', this.data.result); }, }, });