vue-router-smart-scroll
A vue-router plugin that enables configurable recall of scroll positions when visiting routes.
Environments
This plugin supports Vue version 2 and is written in ES6. You will need a transpiler to run this plugin on older browsers.
Installation
yarn add vue-router-smart-scroll
npm install vue-router-smart-scroll
Usage
"Install" this plugin to an existing router instance like so:
;; const router = mode: 'history' // using history mode is helpful for automatic savedPosition support on browser back/forward routes: // whatever your routes are!; // Install & Configure Router Smart ScrollRouterSmartScroll;
Options
RouterSmartScroll;
Matching route parameters
Using the exclude
or include
options to match route paratemers is super easy!
$route = name: 'home' params: lastPosition: true someOtherParam: false RouterSmartScroll;