This commit is contained in:
theluyuan 2021-07-07 17:08:47 +08:00
parent d3d64cd25e
commit 29736567e8
3 changed files with 17 additions and 5 deletions

View File

@ -32,7 +32,7 @@ const routes = [
{
path: '/index', component: index, children: [
{
path: 'foo', component: foo, children: [{
path: 'foo/:name/:age', name:"foo", component: foo, children: [{
path: 'aaa', component: bar
}]
},

View File

@ -12,8 +12,17 @@
export default {
methods:{
getzhi(){
// let a = ""
// let b = 18;
// // let str = "" + a + "" + b
// //
// let str = `${a}${b}`
// console.log(str)
// url
let zhi = this.$route.query
// params url
let zhi = this.$route.params
console.log(zhi)
}
}

View File

@ -4,8 +4,6 @@
<el-menu
default-active="2"
class="el-menu-vertical-demo menu"
@open="handleOpen"
@close="handleClose"
>
<el-menu-item index="2" @click="toindex">
<i class="el-icon-menu"></i>
@ -31,10 +29,15 @@ export default {
this.$router.push("/index")
},
tobar(){
// "/index/bar" path
this.$router.push("/index/bar")
},
tofoo(){
this.$router.push("/index/foo")
// { name } name
// params 使 使 path
// this.$router.push({ path:"/index/foo",params:{name:"111"} })
this.$router.push({ name:"foo",params:{name:"aaaa",age:18} })
}
},
};