@yyx990803 yyx990803 released this Jan 19, 2017 · 15 commits to dev since this release


  • #1104 fix regression in IE9



@yyx990803 yyx990803 released this Jan 18, 2017 · 18 commits to dev since this release


  • #967 fix getAttribute error when the element rendered by <router-link> doesn't have the method (e.g. SVG elements) (@AnthonySendra)
  • #983 respect base in abstract mode (@Atinux via #1045)
  • #987 support nested children for aliased paths
    -#1036 fix checking e.button for non-mouse events (@fnlctrl via #1037)
  • #1091 fix active route matching (@posva via #1101)
  • <router-view> now preserves rendered route component when the tree is toggled inactive by <keep-alive>.



@yyx990803 yyx990803 released this Dec 1, 2016 · 63 commits to dev since this release


  • #725 fixed regression
  • #969 fix href generation for links in hash mode with no base



@yyx990803 yyx990803 released this Nov 29, 2016 · 68 commits to dev since this release

Dist File Change

The main for the NPM package is now vue-router.common.js. This requires no change for existing build setups. The only difference is that the CDN link for the browser-build is now https://unpkg.com/vue-router@2.0.3/dist/vue-router.js.


  • New method: router.resolve() (@hogart via #918). The user can use this method to get a resolved route object or href string. The signature for this method is:

    resolve (to: RawLocation, current?: Route, append?: boolean): {
      normalizedTo: Location;
      resolved: Route;
      href: string;
  • router.getMatchedComponents() can now resolve and determine the matched components for the location passed to it as argument. Note during server-side rendering, you will still need to explicitly router.push() the url so that the $route object is available to data preFetch functions.

  • router.push() and router.replace() can now accept a location object with just params:

    router.push({ params: { foo: 'bar' }})

    Note this will do nothing if the current active route doesn't have the matching params; it is your responsibility to ensure this only gets called on appropriate routes.

  • router.push() and router.replace() now also accept append: true in the location object:

    // will navigate to /foo/bar from /foo
      path: 'bar',
      append: true
  • When using next in route navigation for a redirect, guards now accept replace: true in the location object:

    router.beforeEach((to, from, next) => {
      if (to.path === '/foo') {
          path: '/bar',
          replace: true
  • New prop event for <router-link>, allows defining the events to trigger a navigation. Can be a string or an Array of strings.


  • #853 fix hashchange listener not set up if initial route is a redirect
  • #906 fix named routes navigation using old route params (@znck via #917)
  • #908 respect deeper routes of the same path
  • #922 fix navigation without an app instance
  • #926 avoid rearranging query parameter orders (@miccycn via #946)



@yyx990803 yyx990803 released this Nov 18, 2016 · 92 commits to dev since this release


  • #906 named routes navigation keeps unnecessary old params (@znck via #910)



@yyx990803 yyx990803 released this Nov 14, 2016 · 98 commits to dev since this release


  • #779 fix beforeRouteEnter's next(vm => {}) not always called when using the same component for multiple routes
  • #780 <router-link> now sets a hashed path to href when using hash-mode (@LinusBorg via #809)
  • #795 Allow calling router instance methods before vue instantiation (@fnlctrl via #797)
  • #805 Allow alias option to be an empty string (@LinusBorg via #806)
  • #810 fix <router-link> with tag prop not updating static inner <a>
  • #813 fix sessionStorage quota error in Safari private mode
  • #818 fix in-component router hooks not working with Vue.extend
  • fix in-component router hooks not working with mixins
  • #826 router-link active inclusive match should ignore trailing slash
  • #827 Support target="_blank" for <router-link> (@fnlctrl via #830)
  • #850 Allow route to use current params to fill ones it does not provide (@wjmao88 via #851)
  • #873 fix $route.query compat with 3rd party libs due to lack of hasOwnProperty
  • #887 fix beforeRouteLeave that prevents a navigation not called when history.back() is called more than once (@crossjs via #894)



@yyx990803 yyx990803 released this Oct 13, 2016 · 140 commits to dev since this release


  • #707 using tag prop on <router-link> breaks navigation (@fnlctrl via #708)
  • #725 beforeEnter fire twice on root path ('/') after async next call (@billouboq via #735)
  • #726 router.go not working in abstract mode
  • #750 next in beforeRouteEnter sometimes doesn't receive vm instance
  • #756 avoid navigation on non-left-clicks (@LinusBorg via #758)



@yyx990803 yyx990803 released this Sep 29, 2016 · 169 commits to dev since this release


  • Fix abstract history missing this.ensureURL during SSR
  • Update TypeScript declarations to match 2.0.0-rc.6 changes



@yyx990803 yyx990803 released this Sep 28, 2016 · 174 commits to dev since this release

Breaking Change

  • Navigation guards signature change:

    // before
    router.beforeEach((route, redirect, next) => {
      // ...call redirect or next, or call nothing
    // after
    router.beforeEach((to, from, next) => {
      // always call next

    The next function now serves as the only function that needs to be called (and must be called), but the behavior will be determined by the arguments:

    • next() - calling with no arguments moves on to the next guard in the pipeline.
    • next(false) - calling with false explicitly aborts the navigation.
    • next('/other-path') or next({ path: '/other-path' }): - calling with a string or location descriptor object aborts current navigation and starts a new one (same as redirect previously)

    Regardless of the arguments, the next function should always be called in all conditional branches.

    We are sorry for a breaking change in an RC release, but a way to explicitly abort the navigation is needed to fix #692. As a result the user needs to call one of next, redirect or abort and can make the guard functions very messy, so we decided to fold all three into the same function.