From: Eduardo San Martin Morote Date: Thu, 11 Jul 2019 17:49:52 +0000 (+0200) Subject: test: fix demo compilation X-Git-Tag: v4.0.0-alpha.0~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7159577a7dab190292e29cfebaddabc643f987f0;p=thirdparty%2Fvuejs%2Frouter.git test: fix demo compilation --- diff --git a/explorations/html5.ts b/explorations/html5.ts index 0673dc17..19128c0c 100644 --- a/explorations/html5.ts +++ b/explorations/html5.ts @@ -56,7 +56,7 @@ const router = new Router({ { path: '/users/:id', name: 'user', component: User }, { path: '/documents/:id', name: 'docs', component: User }, { path: '/n/:n', name: 'increment', component }, - { path: '/multiple/:a/:b', name: 'user', component }, + { path: '/multiple/:a/:b', name: 'multiple', component }, { path: '/with-guard/:n', name: 'guarded', diff --git a/src/components/Link.ts b/src/components/Link.ts index 597bea8e..ed37322c 100644 --- a/src/components/Link.ts +++ b/src/components/Link.ts @@ -19,6 +19,7 @@ const Link: Component = { const from = this.$route as RouteLocationNormalized // @ts-ignore can't get `this` const to = this.to as RouteLocation + // @ts-ignore can't get `this` const history = router.history let url: HistoryLocationNormalized diff --git a/src/matcher.ts b/src/matcher.ts index 15539be2..cfd6d4db 100644 --- a/src/matcher.ts +++ b/src/matcher.ts @@ -175,7 +175,9 @@ export function createRouteMatcher( } } - function scoreForSegment(group: pathToRegexp.Token): number { + const scoreForSegment = function scoreForSegment( + group: pathToRegexp.Token + ): number { let score = PathScore.Segment if (typeof group === 'string') { score += group === '/' ? PathScore.Root : PathScore.Static @@ -190,7 +192,9 @@ export function createRouteMatcher( return score } - function scoreForSubSegment(group: pathToRegexp.Token): number { + const scoreForSubSegment = function scoreForSubSegment( + group: pathToRegexp.Token + ): number { let score = 0 if (typeof group === 'string') { // in a sub segment, it doesn't matter if it's root or not