Skip to content

Releases: vuejs/vue-router

v3.0.1

13 Oct 16:26
Compare
Choose a tag to compare

Fixed

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

v2.8.1

13 Oct 16:21
Compare
Choose a tag to compare

Fixed

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

v3.0.0

11 Oct 22:16
Compare
Choose a tag to compare

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'

v2.8.0

11 Oct 22:11
Compare
Choose a tag to compare

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)

v2.7.0

29 Jun 04:00
Compare
Choose a tag to compare

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)

v2.6.0

17 Jun 15:58
Compare
Choose a tag to compare

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 /

v2.5.3

01 May 08:11
Compare
Choose a tag to compare

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

v2.5.2

25 Apr 05:01
Compare
Choose a tag to compare

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)

v2.5.1

24 Apr 09:32
Compare
Choose a tag to compare

Fixed

  • #1365 fix incorrect duplicate params warning

v2.5.0

24 Apr 07:24
Compare
Choose a tag to compare

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