seam 8 жил өмнө
parent
commit
55f7fe0225

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
www/vue/dist/static/js/app.js


+ 9 - 2
www/vue/src/main.js

@@ -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)中止导航,于是页面回到跳转前
 })
 
 // 注册全局组件

+ 1 - 0
www/vue/src/router/index.js

@@ -1,5 +1,6 @@
 export default[
   {path: '/', component: require('../components/home')},
+  {path: '/index.php', component: require('../components/home')},
   {path: '/home', component: require('../components/home')},
   {path: '/product', component: require('../components/product')},
   {path: '/mine', component: require('../components/mine')},

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно