]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add breaking change to list
authorEduardo San Martin Morote <posva13@gmail.com>
Sat, 28 Mar 2020 20:40:04 +0000 (21:40 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Sat, 28 Mar 2020 20:40:04 +0000 (21:40 +0100)
README.md
playground/views/LongView.vue

index 5e41c70826aad592a7a2147fd5a76c17e993f1fe..1b2f4cf1b8cbd287f5e879d8101595b2fa693388 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,6 +13,12 @@ Since the library is still unstable **and because we want feedback** on bugs and
 - `mode: 'history'` -> `history: createWebHistory()`
 - Catch all routes (`/*`) must now be defined using a parameter with a custom regex: `/:catchAll(.*)`
 
+#### Improvements
+
+These are technically breaking changes but they fix an inconsistent behavior.
+
+- Pushing or resolving a non existant named route throws an error instead of navigating to `/` and displaying nothing.
+
 ### Missing features
 
 - `keep-alive` is not yet supported
index a1e06a7f7302357a14f734c095716e28f996c4f7..8abe02e9adde3f4889a36d721e6c72c814720498 100644 (file)
@@ -1,6 +1,6 @@
 <template>
   <section>
-    <div class="long">
+    <div class="long" id="top">
       This one is long: {{ route.params.n }}. Go down to click on a link
     </div>
     <p class="long">
@@ -9,16 +9,18 @@
         >/long-{{ Number(route.params.n || 0) + 1 }}</router-link
       >
     </p>
+    <a href="#top">Go to top</a>
   </section>
 </template>
 
 <script>
-import { defineComponent, inject } from 'vue'
+import { defineComponent } from 'vue'
+import { useRoute } from '../../src'
 
 export default defineComponent({
   name: 'LongView',
   setup() {
-    const route = inject('route')
+    const route = useRoute()
     return { route }
   },
 })