Skip to content

v2.0.0-beta.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@yyx990803 yyx990803 released this 27 Jul 04:51
· 1329 commits to dev since this release

Breaking Changes from beta.1

  • beforeEach and afterEach are reverted as router instance methods (options removed). This makes it more convenient for plugins/modules to add hooks after the router instance has been created.

  • scrollBehavior change:

    Instead of returning { hash: true } to scroll to an anchor, return { selector: route.hash } instead. This also means you can return any CSS selectors to scroll to the element that matches the selector.

    In addition, you can do return { selector: '...', x: 0, y: 0 }. Here the router will first attempt to scroll to the matching element. If no matching element is found, it will fallback to the x and y positions.

    See update example.