From d20cde1f1fbcd2d258ff0dc36fa98f0530304db3 Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Fri, 11 Mar 2016 22:35:55 +0900 Subject: [PATCH] Fix delegate v-link when router has root configuration --- src/directives/link.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/directives/link.js b/src/directives/link.js index 3e24a0bbf..ec3ebd162 100644 --- a/src/directives/link.js +++ b/src/directives/link.js @@ -91,8 +91,12 @@ export default function (Vue) { } if (el.tagName === 'A' && sameOrigin(el)) { e.preventDefault() + var path = el.pathname + if (this.router.history.root) { + path = path.replace(this.router.history.rootRE, '') + } this.router.go({ - path: el.pathname, + path: path, replace: target && target.replace, append: target && target.append })