chore: vue-router-next api change

This commit is contained in:
chenjiahan
2020-04-19 14:33:56 +08:00
parent 722aacb97f
commit 7551238d37
5 changed files with 20 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
import { nextTick } from 'vue';
import VueRouter from 'vue-router';
import { createRouter, createWebHashHistory } from 'vue-router';
import DemoHome from './components/DemoHome';
import { decamelize } from '../common';
import { demos, config } from 'site-mobile-shared';
@@ -81,8 +81,8 @@ function getRoutes() {
return routes;
}
export const router = new VueRouter({
mode: 'hash',
export const router = createRouter({
mode: createWebHashHistory(),
routes: getRoutes(),
scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 },
});