v0.7.8
New
-
Route components can now directly access the router as
this.$router. -
Route components now emit a
route-data-loadedevent when the data hook is resolved. (@lepture) -
You can now use the
v-link-activedirective to specify a different element wherev-linkactive classes should be applied on. Example:<ul> <li v-link-active> <a v-link="{ path: '/xxx' }">Go</a> </li> </ul>
v-linkwill locate the closest parent element that hasv-link-activeand apply the active classes on that element instead. -
When using
v-linkto navigate to a named route, the router will now automatically inherit params from the current parent route. For example:- you are at
/user/123 - you are trying to navigate to a named route
postwith the path/user/:id/post/:post_idusingv-link="{ name: 'post', params: { post_id: 234 }}".
Previously the user id would become
undefined. Now it automatically inherits123. - you are at
-
router.map,router.on,router.redirect,router.alias,router.beforeEachandrouter.afterEachnow returns the router instance so that they can be chained.
Fixed
- Fix override causing
new Vue()without options to fail. (@decademoon) - #293 fix error when
<router-view>is placed insidev-if.