소스 검색

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

陈雪 1 개월 전
부모
커밋
fdbc2caa0d
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/components/shop-tabbar/shop-tabbar.vue

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

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