v0.7.8
New
-
Route components can now directly access the router as
this.$router
. -
Route components now emit a
route-data-loaded
event when the data hook is resolved. (@lepture) -
You can now use the
v-link-active
directive to specify a different element wherev-link
active classes should be applied on. Example:<ul> <li v-link-active> <a v-link="{ path: '/xxx' }">Go</a> </li> </ul>
v-link
will locate the closest parent element that hasv-link-active
and apply the active classes on that element instead. -
When using
v-link
to 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
post
with the path/user/:id/post/:post_id
usingv-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.beforeEach
androuter.afterEach
now 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
.