Commit 6b9ff314aa8b8bec7c4c3333eef5a67f8453d2b2

Authored by zhiyangdu
1 parent 5f2a223b

初始化加载爱心屋数据

src/components/tabBox/tabBox.vue
... ... @@ -95,13 +95,21 @@
95 95 style7,
96 96 },
97 97 created(){
98   - // 初始化的时选中关爱屋
99   - this.tabbaromponents = this.tabbar.find((item)=>{
100   - return item.title === "关爱屋"
101   - });
  98 + // 初始化的时选中关爱屋
  99 + if(this.tabbar&&this.tabbar[0]&&this.tabbar[0].ads){
  100 + this.tabbaromponents = this.tabbar[0]
  101 + }
102 102 // 获取爱心屋全部商品数据
103 103 this.shopRecommendGoods(this.paging.commodity.page)
104 104 },
  105 + methods(){
  106 + // 初始化的时选中关爱屋
  107 + if(this.tabbar&&this.tabbar[0]&&this.tabbar[0].ads){
  108 + debugger
  109 + this.tabbaromponents = this.tabbar[0].ads
  110 + console.log(this.tabbaromponents)
  111 + }
  112 + },
105 113 methods: {
106 114 onChange(name, title) {
107 115 // 切换tab时判断展示哪个组件
... ...