diff --git a/vue/src/layout/component/Main/component/Breadcrumb.vue b/vue/src/layout/component/Main/component/Breadcrumb.vue index 2f2806b..5fc6f5e 100644 --- a/vue/src/layout/component/Main/component/Breadcrumb.vue +++ b/vue/src/layout/component/Main/component/Breadcrumb.vue @@ -13,9 +13,11 @@ export default { data: () => ({data: []}), watch: { - $route(route) { - if (route.path.startsWith('/redirect')) return - this.getBreadcrumb() + $route: { + immediate: true, + handler(route) { + !route.path.startsWith('/redirect') && this.getBreadcrumb() + } } }, @@ -24,10 +26,6 @@ export default { // only show routes with meta.title this.data = this.$route.matched.filter(item => item.meta.title) } - }, - - mounted() { - this.getBreadcrumb() } } @@ -35,7 +33,7 @@ export default {