]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: add children routes for explorations
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 16:52:59 +0000 (18:52 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 16:52:59 +0000 (18:52 +0200)
explorations/html5.ts

index c40800808de59cff9b3d6ad6de68e73736dbdfb1..34f257592dba4c3e43d32fcc3f42559b8517ec6a 100644 (file)
@@ -31,6 +31,15 @@ const r = new Router({
       },
     },
     { path: '/cant-leave', component: GuardedWithLeave },
+    {
+      path: '/children',
+      component,
+      children: [
+        { path: '', name: 'default-child', component },
+        { path: 'a', name: 'a-child', component },
+        { path: 'b', name: 'b-child', component },
+      ],
+    },
     // { path: /^\/about\/?$/, component },
   ],
 })
@@ -106,6 +115,11 @@ async function run() {
   await r.push({
     hash: '#hey',
   })
+
+  await r.push('/children')
+  await r.push('/children/a')
+  await r.push('/children/b')
+  await r.push({ name: 'a-child' })
 }
 
 run()