You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
815 B
34 lines
815 B
2 years ago
|
"use strict";
|
||
|
Component({
|
||
|
properties: {
|
||
|
topList: {
|
||
|
type: Array,
|
||
|
value: []
|
||
|
}
|
||
|
},
|
||
|
data: {
|
||
|
singleComponent: ''
|
||
|
},
|
||
|
lifetimes: {
|
||
|
attached: function () {
|
||
|
console.log('topList attached');
|
||
|
this.initComponentData();
|
||
|
},
|
||
|
detached: function () {
|
||
|
},
|
||
|
ready: function () {
|
||
|
console.log('topList组件渲染完毕');
|
||
|
this.triggerEvent('callParentFun');
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
initComponentData: function () {
|
||
|
console.log(this.data.topList[0].componentFrontId);
|
||
|
var componentFrontId = this.data.topList[0].componentFrontId;
|
||
|
this.setData({
|
||
|
singleComponent: componentFrontId
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|