Component({
data: {
dtest: 'dtest'
},
ptest: 'ptest',
lifetimes: {
created() {
this.test = 'test'
console.log({
time: 'created',
dtest: this.data.dtest, // dtest
ptest: this.ptest, // undefined
test: this.test // test
})
},
},
})
这种方式的初始化不会生效
目前暂时的解决方案就是在Component的created的时候进行私有属性init操作
https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/pure-data.html