/* * @Author: 小明丶 * @Date: 2019-08-19 15:23:17 * @LastEditors: 小明丶 * @LastEditTime: 2021-01-08 10:00:52 * @Description: */ import Vue from "vue"; import VueRouter from 'vue-router'; import routes from './routes'; import Store from '@/store'; Vue.use(VueRouter); let router = new VueRouter({ mode:"hash", //history routes, scrollBehavior (to, from, savedPosition) { return { x:0, y:0 } }, }) // 全局前置守卫:页面跳转前拦截 router.beforeEach((to, from, next) => { next() }) //全局后置守卫:页面跳转后执行 router.afterEach((to, from) => { }) export default router;