router.js 383 B

123456789101112131415161718192021222324
  1. // router.js
  2. import {
  3. RouterMount,
  4. createRouter
  5. } from 'uni-simple-router';
  6. const router = createRouter({
  7. platform: process.env.VUE_APP_PLATFORM,
  8. routes: [...ROUTES]
  9. });
  10. //全局路由前置守卫
  11. router.beforeEach((to, from, next) => {
  12. next();
  13. });
  14. // 全局路由后置守卫
  15. router.afterEach((to, from) => {
  16. console.log('跳转结束')
  17. })
  18. export {
  19. router,
  20. RouterMount
  21. }