import Vue from 'vue' import Router from 'vue-router' import routes from './routes' import Setting from '@/setting' Vue.use(Router) const createRouter = () => new Router({ mode: Setting.routerMode,     base: process.env.BASE_URL, scrollBehavior: () => ({ y: 0 }), routes }) export function resetRouter () { const newRouter = createRouter() router.matcher = newRouter.matcher } let router = createRouter() export default router