Skip to content

Commit 28a5322

Browse files
committed
面包屑导航回滚回 computed 模式
1 parent 1100646 commit 28a5322

File tree

1 file changed

+6
-6
lines changed
  • src/layouts/components/Topbar/Toolbar/Breadcrumb

1 file changed

+6
-6
lines changed

src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ const route = useRoute()
88
99
const settingsStore = useSettingsStore()
1010
11-
const breadcrumbList = ref<{ path: string, title: string }[]>([])
12-
watch(() => route.matched, () => {
11+
// 面包屑备份
12+
let breadcrumbListBackup: any = []
13+
const breadcrumbList = computed(() => {
1314
if (route.name === 'reload') {
14-
return
15+
return breadcrumbListBackup
1516
}
1617
const list = []
1718
if (settingsStore.settings.home.enable) {
@@ -28,9 +29,8 @@ watch(() => route.matched, () => {
2829
})
2930
}
3031
})
31-
breadcrumbList.value = list
32-
}, {
33-
immediate: true,
32+
breadcrumbListBackup = list
33+
return list
3434
})
3535
3636
function pathCompile(path: string) {

0 commit comments

Comments
 (0)