Commit ddfd31db authored by wuwangwolihui's avatar wuwangwolihui

路由跳转修改

parent 2a9d7b5d
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
</div> </div>
<div> <div>
<div class="code flex"> <div class="code flex">
<el-input v-model="input"></el-input> <el-input v-model="input1"></el-input>
<el-input v-model="input"></el-input> <el-input v-model="input2"></el-input>
<el-input v-model="input"></el-input> <el-input v-model="input3"></el-input>
<el-input v-model="input"></el-input> <el-input v-model="input4"></el-input>
</div> </div>
<div class="errorCode">该邀请码无效,请输入正确的邀请码。</div> <div class="errorCode">该邀请码无效,请输入正确的邀请码。</div>
</div> </div>
...@@ -30,6 +30,14 @@ ...@@ -30,6 +30,14 @@
/* eslint-disable */ /* eslint-disable */
export default { export default {
name: "Invitation", name: "Invitation",
data(){
return{
input1: null,
input2: null,
input3: null,
input4: null,
}
}
}; };
</script> </script>
......
...@@ -7,39 +7,40 @@ import indexCamp from './index/camp' ...@@ -7,39 +7,40 @@ import indexCamp from './index/camp'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [{ const routes = [
path: '/', {
meta: { path: '/',
title: '招生简章' meta: {
title: '招生简章'
},
component: () =>
import('v/index/recruit/Index.vue')
}, },
component: () => {
import('v/index/recruit/Index.vue') path: '/login',
}, name: 'loginIndex',
{ meta: {
path: '/login', title: '登录'
name: 'loginIndex', },
meta: { component: () =>
title: '登录' import('v/index/login/Index.vue'),
children: [...indexLogin]
}, },
component: () => {
import('v/index/login/Index.vue'), path: '/:cerificate',
children: [...indexLogin] name: 'cerificateIndex',
}, meta: {
{ title: '营地报名'
path: '/cerificate', },
name: 'cerificateIndex', // redirect: '/cerificate/signUp',
meta: { component: () =>
title: '营地报名' import('v/index/camp/Index.vue'),
}, children: [...indexCamp]
redirect: '/cerificate/signUp', }
component: () =>
import('v/index/camp/Index.vue'),
children: [...indexCamp]
}
] ]
const originalPush = VueRouter.prototype.push const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) { VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch(err => err)
} }
......
...@@ -41,6 +41,17 @@ export default { ...@@ -41,6 +41,17 @@ export default {
this.type = this.$route.params.type; this.type = this.$route.params.type;
console.log(this.$route); console.log(this.$route);
}, },
watch:{
'$route': {
handler(val) {
const that = this;
if(val.path.indexOf('signUp')!=-1){
that.type = val.params.type;
}
},
deep: true
}
}
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment