vue2的双向数据绑定Object.defineProperty存在的缺陷,导致无法同步更新数据,这里用 this.$set方法同步绑定
// An highlighted block
async getIconDetail(){
let data = {
id:this.ID
};
let res = await getPlatformIconD(data);
if(res.code == 200){
if(!!res.data){
this.prizeFormIcon = {
...res.data,
};
this.$set(this.prizeFormIcon, 'wideSize',JSON.parse(this.prizeFormIcon.rule).wideSize )
this.$set(this.prizeFormIcon, 'longSize', JSON.parse(this.prizeFormIcon.rule).longSize)
}
}
},```