v2.0.0-beta.2
Pre-release
Pre-release
Breaking Changes from beta.1
-
beforeEach
andafterEach
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 thex
andy
positions.See update example.