detail的东西不能keep=alive
detail数据的组织方式
后端传过来的数据是非常繁杂的,经常需要把有用的数据整合在一起。
面向对象封装的思想:
把咋乱wuzang的数据整合到一起。
把整合后的数据传递给子组件的话会清晰明显很多。
export class GoodsInfo {
constructor(itemInfo, columns, services) {
this.title = itemInfo.title;
this.desc = itemInfo.desc;
this.newPrice = itemInfo.price;
this.oldPrice = itemInfo.oldPrice;
this.discount = itemInfo.discountDesc;
this.columns = columns;
this.services = services;
this.realPrice = itemInfo.lowNowPrice;
}
}