|
@@ -33,17 +33,17 @@
|
|
|
</ul>
|
|
|
</div> -->
|
|
|
<!-- <div> -->
|
|
|
- <van-tabbar v-model="active" active-color="#4d6add" inactive-color="#404d74">
|
|
|
- <van-tabbar-item replace name="home" to="home" icon="home-o">{{ $t('navBar.homePage') }}</van-tabbar-item>
|
|
|
- <van-tabbar-item replace name="device" to="device" icon="setting-o">{{ $t('navBar.deviceInformation') }}</van-tabbar-item>
|
|
|
- <van-tabbar-item replace name="robotranking" to="robotranking" icon="bar-chart-o">{{ $t('navBar.machineRanking') }}</van-tabbar-item>
|
|
|
- <van-tabbar-item replace name="user" to="user" icon="friends-o">{{ $t('navBar.personalCenter') }}</van-tabbar-item>
|
|
|
+ <van-tabbar route active-color="#4d6add" inactive-color="#404d74">
|
|
|
+ <van-tabbar-item replace to="/home" icon="home-o">{{ $t('navBar.homePage') }}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace to="/device" icon="setting-o">{{ $t('navBar.deviceInformation')}}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace to="/robotranking" icon="bar-chart-o">{{ $t('navBar.machineRanking')}}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace to="/user" icon="friends-o">{{ $t('navBar.personalCenter') }}</van-tabbar-item>
|
|
|
</van-tabbar>
|
|
|
<!-- </div> -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { onMounted, computed, ref } from "vue";
|
|
|
+import { onMounted, computed } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import homeUrl from "@/assets/navbarLogo/home.png";
|
|
|
import homeActiveUrl from "@/assets/navbarLogo/homeActive.png";
|
|
@@ -53,11 +53,11 @@ import rankingUrl from "@/assets/navbarLogo/ranking.png";
|
|
|
import rankingActiveUrl from "@/assets/navbarLogo/rankingActive.png";
|
|
|
import userUrl from "@/assets/navbarLogo/user.png";
|
|
|
import userActiveUrl from "@/assets/navbarLogo/userActive.png";
|
|
|
-import { useRouter } from "vue-router";
|
|
|
+// import { useRouter } from "vue-router";
|
|
|
|
|
|
export default {
|
|
|
setup() {
|
|
|
- const router = useRouter()
|
|
|
+ // const router = useRouter()
|
|
|
const store = useStore();
|
|
|
onMounted(() => {
|
|
|
// const token = getLocal('token')
|
|
@@ -65,15 +65,19 @@ export default {
|
|
|
// if (token && !['/home', '/category'].includes(path)) {
|
|
|
// store.dispatch('updateCart')
|
|
|
// }
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
const count = computed(() => {
|
|
|
return store.state.cartCount;
|
|
|
});
|
|
|
- const active = ref('home');
|
|
|
- router.afterEach(()=>{
|
|
|
- active.value = router.currentRoute.value.name;
|
|
|
- })
|
|
|
+ // const active = ref('home');
|
|
|
+ // router.afterEach(() => {
|
|
|
+ // console.log("路由1", router.currentRoute.value.name)
|
|
|
+ // let currentRouteName = router.currentRoute.value.name;
|
|
|
+ // if (currentRouteName === 'home' || currentRouteName === 'device' || currentRouteName === 'robotranking' || currentRouteName === 'user') {
|
|
|
+ // active.value = currentRouteName;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
return {
|
|
|
count,
|
|
@@ -85,7 +89,7 @@ export default {
|
|
|
rankingActiveUrl,
|
|
|
userUrl,
|
|
|
userActiveUrl,
|
|
|
- active,
|
|
|
+ // active,
|
|
|
};
|
|
|
},
|
|
|
};
|