Browse Source

🎈 perf(tabbar): 动态调整背景图

陈雪 1 month ago
parent
commit
fdbc2caa0d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/components/shop-tabbar/shop-tabbar.vue

+ 5 - 1
src/components/shop-tabbar/shop-tabbar.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="shop-tabbar-container">
+  <view class="shop-tabbar-container" :class="{ 'cart-bg': tabbarStore.curIdx === 2 }">
     <view
       class="tabbar-item"
       @click="selectTabBar(category.path, 1)"
@@ -113,6 +113,10 @@
     background-image: url(@/static/images/tabbar-bg.svg);
     background-size: cover;
 
+    &.cart-bg {
+      background: $shop-white;
+    }
+
     .tabbar-item {
       display: flex;
       flex-direction: column;