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 { isMobile, decamelize } from '../common';
import { config, documents } from 'site-desktop-shared';
import { getLang, setDefaultLang } from '../common/locales';
@@ -98,8 +98,8 @@ function getRoutes() {
return routes;
}
export const router = new VueRouter({
mode: 'hash',
export const router = createRouter({
history: createWebHashHistory(),
routes: getRoutes(),
scrollBehavior(to) {
if (to.hash) {