// components/info-cards/index.js Component({ /** * 组件的属性列表 */ properties: { cardTitle: { type: String, value: '', }, infoList: { type: Array, value: [], }, }, /** * 组件的初始数据 */ data: {}, /** * 组件的方法列表 */ methods: { navTo(e) { let { index } = e.currentTarget.dataset; let item = this.data.infoList[index]; this.triggerEvent('navTo', item); }, }, });