]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
comments
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2019 10:58:19 +0000 (12:58 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2019 10:58:19 +0000 (12:58 +0200)
explorations/html5.ts
src/history/html5.ts

index 9af1d6f5dece664a777bd09d9cbc0e783de1ece2..befece23f8abee27ba95fe21ecebf1a8d00dd349 100644 (file)
@@ -7,6 +7,7 @@ const r = new Router({
   routes: [
     { path: '/', component },
     { path: '/users/:id', name: 'user', component },
+    { path: '/multiple/:a/:b', name: 'user', component },
     // { path: /^\/about\/?$/, component },
   ],
 })
@@ -23,36 +24,38 @@ h.listen((to, from, { type }) => {
   console.log(`popstate(${type})`, { to, from })
 })
 
+r.push('/multiple/one/two')
+
 // h.push('/hey')
 // h.push('/hey?lol')
 // h.push('/foo')
 // h.push('/replace-me')
 // h.replace('/bar')
 
-r.push('/about')
-r.push({
-  path: '/',
-})
+// r.push('/about')
+// r.push({
+//   path: '/',
+// })
 
-r.push({
-  name: 'user',
-  params: {
-    id: '6',
-  },
-})
+// r.push({
+//   name: 'user',
+//   params: {
+//     id: '6',
+//   },
+// })
 
-r.push({
-  name: 'user',
-  params: {
-    id: '5',
-  },
-})
+// r.push({
+//   name: 'user',
+//   params: {
+//     id: '5',
+//   },
+// })
 
-r.push({
-  params: {
-    id: 'no-name',
-  },
-})
+// r.push({
+//   params: {
+//     id: 'no-name',
+//   },
+// })
 
 // r.push({
 //   hash: '#hey',
index f556e0c908a3f5dafe064756d97c247ff158dbba..deabc096da3bf2ffcefa4bfe34b487cd078e0e40 100644 (file)
@@ -43,7 +43,7 @@ export class HTML5History extends BaseHistory {
   constructor() {
     super()
     const to = buildFullPath()
-    cs.log('created', to)
+    // cs.log('created', to)
     this.history.replaceState(buildState(null, to, null), '', to)
     this.location = to
     this._popStateHandler = this.setupPopStateListener()