From cc94b62282066627c9c11d5aa36396863b66adc2 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 9 Nov 2018 16:29:00 +0800 Subject: [PATCH] fix[Breadcurmb]: fixed router-link bug #217 --- 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 2d684f0..7e0f311 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -3,7 +3,7 @@ {{ item.meta.title }} - {{ item.meta.title }} + {{ item.meta.title }} @@ -44,6 +44,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)) } } }