index.js
686 字节
import { createRouter, createWebHashHistory } from 'vue-router'
// import { isWeiXin } from 'detect-mobile-device'
const routes = [
{
path: '/',
name: 'index',
component: () => import(/* webpackChunkName: "index" */ '../views/index/Index.vue')
},
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
// router.beforeEach((to, from, next) => {
// // 本地开发绕过路由守卫
// if (process.env.VUE_APP_MODE === 'development') {
// next()
// }
// if (isWeiXin()) {
// to.name === 'index' ? next() : next('/');
// } else {
// to.name === 'guidePage' ? next() : next('/guidePage');
// }
// })
export default router