有两个方案可以获取到传过来的数据
1. 查询参数传参
2. 动态路由传参
![](https://img-blog.csdnimg.cn/direct/da789d1ee22b47db8993e43efa7e3e81.png)
实践:
![](https://img-blog.csdnimg.cn/direct/309b82c3ae79460ea5414069855c6c45.png)
![](https://img-blog.csdnimg.cn/direct/b2e2fe3c1f1d43d0ba05f16d57c589b8.png)
![](https://img-blog.csdnimg.cn/direct/8aeff456b0454cfc90e5b24c421b0753.png)
发送请求时,在模板当中可以省略this,但是在方法中,this不能省略
![](https://img-blog.csdnimg.cn/direct/137c5b050e11402e8ceb7345310452d3.png)
![](https://img-blog.csdnimg.cn/direct/8bc1a7a4aeef4d0c9a83687747da30e0.png)
2. 动态路由传参
① 配置动态路由
② 配置导航链接
to="/path
/参数值
"
③ 对应页面组件接收传递过来的值
$route.
params.参数名
![](https://img-blog.csdnimg.cn/direct/a3fa7776f8494ea980c7e088bb1f53a8.png)
实践:
配置 路由规则
![](https://img-blog.csdnimg.cn/direct/c737ca53b7c2482b93f3c28731a07af4.png)
配置导航路径
![](https://img-blog.csdnimg.cn/direct/94f40f3d211d432e94e65199e6f68ed7.png)
![](https://img-blog.csdnimg.cn/direct/52df9ad8583a4a47bfea13e092e84b88.png)
![](https://img-blog.csdnimg.cn/direct/f5914b245d47494494cb8d4e6b84dbe2.png)
总结:
![](https://img-blog.csdnimg.cn/direct/42b1ce39c66548a78731ce70a577f4b0.png)
![](https://img-blog.csdnimg.cn/direct/ffcc0b223c3245978d2f074bdf2ac3b0.png)
![](https://img-blog.csdnimg.cn/direct/9e3932b92e5e4273b3a2064b4afb3a2a.png)
实践:
![](https://img-blog.csdnimg.cn/direct/286d2755273145c4af7d263ded5b8212.png)
![](https://img-blog.csdnimg.cn/direct/d6036fc45258482bb7d1eba760a22046.png)
添加?后
![](https://img-blog.csdnimg.cn/direct/6bf91be3194f4eeda933a458ab8c7670.png)
![](https://img-blog.csdnimg.cn/direct/62584546b8614c088fa6c6312e4d4beb.png)