feat : 修改菜单状态
This commit is contained in:
@@ -12,13 +12,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import {useRoute, useRouter} from 'vue-router';
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
watch(route, ()=> {
|
||||
watch(route, () => {
|
||||
getBreadcrumb()
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@ const breadcrumbList = ref([])
|
||||
const getBreadcrumb = () => {
|
||||
let matched = route.matched.filter(item => item.meta && item.meta.title)
|
||||
const first = matched[0]
|
||||
if(!isDashboard(first)) {
|
||||
if (!isDashboard(first)) {
|
||||
matched = [{path: '/home', meta: {title: '首页'}}].concat(matched)
|
||||
}
|
||||
breadcrumbList.value.length = 0;
|
||||
@@ -39,7 +39,7 @@ const getBreadcrumb = () => {
|
||||
|
||||
const isDashboard = (meta) => {
|
||||
const name = meta && meta.name
|
||||
if(!name) {
|
||||
if (!name) {
|
||||
return
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === 'Home'.toLocaleLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user