自定义组件attached中this.data.x无法获取properties值
Component({
properties: {
coinInOrder: {
type: Object,
value: {}
},
totalPrice: {
type: Number,
value: 0
}
},
attached() {
console.log(this.data); // console 能看到 coinInOrder 并不是空对象
console.log(this.data.coinInOrder); // console 能看到 空对象
}
});
ps:observer 里面是能看到 coinInOrder 已经被赋值了,可是我想要在attached 使用coinInOrder 和 totalPrice 传进来的值做一些简单的运算,observer 无法满足呀
