You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.0 KiB
Vue

<template>
<u-tabbar
:value="value"
active-color="var(--w-main)"
inactive-color="var(--w-bg-dark-1)"
border
>
<!-- <u-tabbar-item v-if="authStore.hasRole('student')" name="/pages/student/student-feedback" text="反馈" icon="order" @click="clickItem"></u-tabbar-item> -->
<u-tabbar-item name="/pages/index/index" text="首页" icon="home" @click="clickItem"></u-tabbar-item>
<u-tabbar-item name="/pages/user/index" text="我的" icon="account" @click="clickItem"></u-tabbar-item>
</u-tabbar>
</template>
<script setup>
import { ref } from 'vue'
import { useAuthStore } from '@/store';
const props = defineProps({
name : {
type: String,
default:'/pages/index/index'
}
})
const authStore = useAuthStore();
const value = ref(props.name);
const emit = defineEmits(['change']);
const clickItem = (name)=>{
if(name==props.name){
return;
}
console.debug(name);
emit("change",name);
uni.reLaunch({
url:name
})
}
const clickItemDev=()=>{
uni.showToast({
icon:"error",
title:"开发中..."
})
}
</script>