@yyx990803 yyx990803 released this Oct 13, 2017 · 125 commits to dev since this release

Assets 2

Fixed

  • fix <router-view> props passing regression (#1800, #1809)

@yyx990803 yyx990803 released this Oct 13, 2017 · 138 commits to dev since this release

Assets 2

Fixed

  • fix <router-view> props passing regression (#1800, #1809)

@yyx990803 yyx990803 released this Oct 11, 2017 · 134 commits to dev since this release

Assets 2

Breaking Changes

This major release only breaks backwards compatibility if you use TypeScript.

  • TypeScript type declarations have been updated to be compatible with Vue core 2.5+ and no longer work with 2.4 and below.

  • All type declarations are now exported using ES-style exports, and must be imported using ES modules syntax:

    import VueRouter from 'vue-router'

@yyx990803 yyx990803 released this Oct 11, 2017 · 138 commits to dev since this release

Assets 2

New Features

  • Hash mode now also supports scrollBehavior when the browser supports history.pushState. (@ariesjia via #1662)

  • scrollBehavior now supports returning a Promise. The scrolling will be executed when the Promise is resolved. (@homerjam via #1758)

Fixed

  • #1508 avoid first popstate event with async guard together (@Jinjiang)
  • #1557 do not remove trailing slash in strict mode (@posva)
  • #1568 handle null values when comparing query objects (@posva)
  • #1586 fix scroll when going back to initial route (@hworld)
  • #1690 fix query comparison with deep values shared by reference (effb114)
  • #1695 send props not defined on the route component in $attrs (@lbogdan)
  • Properly resolve async components imported from native ES modules (8a28426)

@yyx990803 yyx990803 released this Jun 29, 2017 · 213 commits to dev since this release

Assets 2

New Features

  • When resolving async components, will now automatically resolve the default export if the component module is an ES module. This is primarily for compatibility with vue-loader@^13.0.0.

Fixed

  • #1519 fix beforeRouteUpdate not having corresponding option merge strategy (@posva via #1521)

@yyx990803 yyx990803 released this Jun 17, 2017 · 224 commits to dev since this release

Assets 2

New Features

  • Now supports nesting abstract routers inside the main router app. Example

  • New route config options:

    • caseSensitive: makes the route match with case sensitivity.

    • pathToRegexpOptions: path-to-regexp options to use when compiling the match regex for this route.

    (@smitt04 via #1215)

  • When returning a selector in scrollBehavior, an additional offset object can also be specified:

    scrollBehavior (to, from, saved) {
      return {
        selector: '#foo',
        offset: { x: 0, y: 10 }
      }
    }

    (@sigerello via #1501)

  • New route instance option: fallback.

    Controls whether the router should fallback to hash mode when the browser does not support history.pushState. Defaults to true.

    Setting this to false essentially makes every router-link navigation a full page refresh in IE9. This is useful when the app is server-rendered and needs to work in IE9, because a hash mode URL does not work with SSR.

    (@JounQin via #1512)

Bug Fixes

  • Added TypeScript definition for linkExactActiveClass (@aicest via #1471)
  • Fix scrollBehavior receiving incorrect from parameter (@mutoo via #1479)
  • Prevent throwing Error when linking to non-existent named route (@posva via #1387)
  • Silence named route default child warning when redirecting (@decademoon via #1442)
  • Fix nested object comparison for queries (@posva via #1425)
  • Fix hash-mode replaceHash() when page has <base> (@daohoangson via #1396)
  • Fix <base> that includes HTTP(S) origin
  • Fix route alias for / and paths nested under /

@yyx990803 yyx990803 released this May 1, 2017 · 277 commits to dev since this release

Assets 2

Fixed

  • #1372 fix beforeRouteEnter next callback firing on wrong instance when used with out-in transition
  • #1381 fix getMatchedComponents error when called with existing route

@yyx990803 yyx990803 released this Apr 25, 2017 · 285 commits to dev since this release

Assets 2

Improvements

  • <router-view> can now properly pass named slots down to the matched component.

Fixed

  • Ensure proper error handling in multi-context environment (e.g. bundleRenderer with different vm context in Node.js)

@yyx990803 yyx990803 released this Apr 24, 2017 · 290 commits to dev since this release

Assets 2

Fixed

  • #1365 fix incorrect duplicate params warning

@yyx990803 yyx990803 released this Apr 24, 2017 · 294 commits to dev since this release

Assets 2

New

  • New method: router.beforeResolve(). Registers a global route guard similar to router.beforeEach(), except that it is called right before a navigation is confirmed, after all other guards and async components have been resolved.

  • router.beforeEach, router.beforeResolve and router.afterEach now return a function that removes the registered guard/hook when called.

  • A router-link now also automatically gets a router-link-exact-active class when the current route is an exact match with its destination. The class can also be configured via the exact-active-class prop or the global linkExactActiveClass router option. (@caikan via #1361)

Fixed

  • Ensure consistent path matching priority in all JavaScript environments
  • #1176 ensure wildcard routes are always matched last
  • #1320 avoid triggering beforeRouteUpdate and beforeRouteLeave for instances that are not created yet
  • #1322, #1338 fix hooks losing instance reference when same component is used for mutiple routes
  • #1323 fix active class priority (@posva via #1324)
  • #1329 avoid resolving async components before guards have been resolved