]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: useLink example
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 19 Jan 2021 21:41:35 +0000 (22:41 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 19 Jan 2021 21:41:35 +0000 (22:41 +0100)
docs/guide/advanced/extending-router-link.md

index 6b035931f7a20b22247c422ffb241c153bc008ac..592e079d54049d453d61fc057395728c9945f991 100644 (file)
@@ -62,15 +62,13 @@ export default {
   },
 
   setup(props) {
-    // toRef allows us to extract one prop and keep it reactive
-    // https://v3.vuejs.org/api/refs-api.html#toref
-    const { navigate, href, route, isActive, isExactActive } = useLink(toRef(props, 'to'))
-
+    // `props` contains `to` and any other prop that can be passed to <router-link>
+    const { navigate, href, route, isActive, isExactActive } = useLink(props)
 
     // profit!
 
     return { isExternalLink }
-  }
+  },
 }
 ```