]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: fix demo compilation
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 11 Jul 2019 17:49:52 +0000 (19:49 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 17 Jul 2019 11:42:36 +0000 (13:42 +0200)
explorations/html5.ts
src/components/Link.ts
src/matcher.ts

index 0673dc1793f2c2e91dd67fe4b5f45a868d3ea2da..19128c0cdddf0d43593366e275edebabc4f979f5 100644 (file)
@@ -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',
index 597bea8ecc694d8990a0e94e6fd280a9a23d9ebe..ed37322c5d14588c23e0b7daa4f61e65c9d4d9fa 100644 (file)
@@ -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
index 15539be2e155223d836bdf1fdfd02a1fdf9f337f..cfd6d4dbdbda29923e1ff7ab09ce9861a05d5186 100644 (file)
@@ -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