2.17

久违的更新

Vue2 跳转传参

//跳转传参
//通过查询参数传参
//to="/路径?参数名=参数值"
//接收
//$route.query.参数名
// 通过动态路由传参:
// 首先要设置动态路由
// {
//     path:'/ssss/:words'
// }
//然后 配置导航链接
// to="/路径/参数值"
//接收
//$route.params.参数名
//通过路径的方式传参
// (1)this.$route.push('路径名') 【简写】
//    this.$route.push('路径?参数名=参数值')
//this.$route.push('/about')
//this.$route.push(`/about?key=${this.inpValue}`)
// (2)this.$route.push({  【详细】
//     path:'路由路径'
//     query:{
//         参数名:参数值,
//         参数名:参数值
//     }

// })
//通过$route.params.
 路由重定向 
redirect
   and 
返回上一页
 $router.back()
posted @ 2024-02-17 09:40  晨观夕  阅读(3)  评论(0编辑  收藏  举报