import Vue from 'vue' import Router from 'vue-router' import HomeLayout from './components/Home.vue'; import HomeLayout2 from './components/HomeV2.vue'; Vue.use(Router) const router = new Router({ mode: 'history', base: process.env.BASE_URL, linkActiveClass: "WM-Active", linkExactActiveClass: "WM-Exact-Active", routes: [ { path: '*', redirect: '/Home' }, { path: '/Home', component: HomeLayout }, { path: '/Home2', component: HomeLayout2 }, ] }) router.beforeResolve((to, from, next) => { if (to.name && router.app.$children[0] != undefined) router.app.$children[0].loadingVisible = true; setTimeout(() => { next(); }, 500) }) router.afterEach(() => { if (router.app.$children[0] != undefined) router.app.$children[0].loadingVisible = false; }) export default router;