Component({ properties: { topList: { type: Array, value: [] } }, data: { singleComponent: '' }, lifetimes: { attached: function () { // 在组件实例进入页面节点树时执行 console.log('topList attached') this.initComponentData() }, detached: function () { }, ready(){ console.log('topList组件渲染完毕') //let viewHeight = 0 this.triggerEvent('callParentFun') } }, methods: { initComponentData(){ console.log(this.data.topList[0].componentFrontId) let componentFrontId = this.data.topList[0].componentFrontId this.setData({ singleComponent: componentFrontId }) } } })