From 6f5591c290fe3286e34fc7e42875bac0cb98c6f8 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 9 Nov 2018 17:59:34 +0800 Subject: [PATCH] fix[Breadcurmb]: fixed router-link bug --- src/components/Breadcrumb/index.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 70ecbf1b..554abe8d 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -3,7 +3,7 @@ {{ generateTitle(item.meta.title) }} - {{ generateTitle(item.meta.title) }} + {{ generateTitle(item.meta.title) }} @@ -46,6 +46,14 @@ export default { const { params } = this.$route var toPath = pathToRegexp.compile(path) return toPath(params) + }, + handleLink(item) { + const { redirect, path } = item + if (redirect) { + this.$router.push(redirect) + return + } + this.$router.push(this.pathCompile(path)) } } }