Skip to content

v0.7.8

Compare
Choose a tag to compare
@yyx990803 yyx990803 released this 11 Jan 21:47
· 1461 commits to dev since this release

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 where v-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 has v-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 using v-link="{ name: 'post', params: { post_id: 234 }}".

    Previously the user id would become undefined. Now it automatically inherits 123.

  • router.map, router.on, router.redirect, router.alias, router.beforeEach and router.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 inside v-if.