From e3c8b2a15764f7e080766e2c29ff24015643bc88 Mon Sep 17 00:00:00 2001 From: kenji suzuki Date: Tue, 26 May 2020 16:10:22 +0900 Subject: [PATCH] fix(link): href of router-link does not check root path --- packages/router/src/components/route-link/route-link.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/router/src/components/route-link/route-link.tsx b/packages/router/src/components/route-link/route-link.tsx index e5da8d8..b85d38a 100644 --- a/packages/router/src/components/route-link/route-link.tsx +++ b/packages/router/src/components/route-link/route-link.tsx @@ -92,10 +92,12 @@ export class RouteLink implements ComponentInterface { anchorAttributes.class[this.anchorClass] = true; } + const href = this.url && this.root ? getUrl(this.url, this.root) : this.url; + if (this.custom === 'a') { anchorAttributes = { ...anchorAttributes, - href: this.url, + href: href, title: this.anchorTitle, role: this.anchorRole, tabindex: this.anchorTabIndex,