|
@@ -16,8 +16,15 @@ import VueAwesomeSwiper from 'vue-awesome-swiper'
|
|
|
Vue.use(VueAwesomeSwiper)
|
|
|
|
|
|
const router = new VueRouter({
|
|
|
- routes,
|
|
|
- mode: 'history'
|
|
|
+ mode: 'history',
|
|
|
+ routes
|
|
|
+})
|
|
|
+
|
|
|
+router.beforeEach((to, from, next) => {
|
|
|
+ console.log('小弟B:哎呀妈呀!大兄弟,这是要去哪呀?', to)
|
|
|
+ console.log('小弟A:大兄弟,哪儿旮沓的呀!', from)
|
|
|
+ next(true) // 大哥:谁让你过去的?
|
|
|
+ // 调用next(false)中止导航,于是页面回到跳转前
|
|
|
})
|
|
|
|
|
|
// 注册全局组件
|