TraceabilityAPP/components/customTabbar/tabbar.vue

74 lines
1.8 KiB
Vue
Raw Normal View History

2023-12-25 00:26:32 +08:00
<template>
2024-01-11 17:16:07 +08:00
<u-tabbar :value="value1" :fixed="true" :placeholder="false" :safeAreaInsetBottom="true">
2023-12-25 00:26:32 +08:00
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/sydj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/sy.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/dkdj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/dk.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/wddj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/tabs-icon/wd.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
</u-tabbar>
</template>
<script setup>
import store from "@/store/index.js"
import {
ref
} from "vue"
console.log(store.state.tabbrIndex)
const value1 = ref(store.state.tabbrIndex)
const click1 = (e) => {
store.dispatch('changeTabbar', e)
// console.log(, 454)
if (e == 0) {
uni.switchTab({
url: '/pages/index/massif'
})
}
if (e == 1) {
uni.switchTab({
url: '/pages/index/index'
})
}
if (e == 2) {
uni.switchTab({
url: '/pages/index/personal'
})
}
}
</script>
<style>
</style>