瀏覽代碼

图片路径修改

tanxue 1 月之前
父節點
當前提交
3f44269537
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      components/custom-tabbar/custom-tabbar-client.vue

+ 6 - 5
components/custom-tabbar/custom-tabbar-client.vue

@@ -1,7 +1,8 @@
 <template>
 	<view class="phone-client-tabbar">
 		<view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path,index)">
-			<icon class="tabbar-item-icon" :style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }"></icon>
+			<!-- <icon  :style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }"></icon> -->
+			<image class="tabbar-item-icon" :src="currentTab === index ? item.activePath : item.iconPath" mode="aspectFit"></image>
 			<text class="tabbar-item-text">{{item.text}}</text>
 		</view>
 	</view>
@@ -24,14 +25,14 @@
 				tabList: [{
 						text: '首页',
 						path: `/pages/client/ShouYe/shouye`,
-						iconPath: 'static/images/tabbar/unselect/client-jz-icon.png',
-						activePath:'static/images/tabbar/select/client-jz-icon.png',
+						iconPath: '/static/images/tabbar/unselect/client-jz-icon.png',
+						activePath:'/static/images/tabbar/select/client-jz-icon.png',
 					},
 					{
 						text: '我的',
 						path: `/pages/client/my/index`,
-						iconPath: 'static/images/tabbar/unselect/client-my-icon.png',
-						activePath: 'static/images/tabbar/select/client-my-icon.png',
+						iconPath: '/static/images/tabbar/unselect/client-my-icon.png',
+						activePath: '/static/images/tabbar/select/client-my-icon.png',
 					},
 				],
 			};