1、a 标签+传参
html
<router-link :to="`supplyList/id/0`" >查看补货清单</router-link>
roter
{path:"supplyList/id/:id",name:"SupplyList",component: SupplyList},
2、 返回上一页、刷新、跳转指定页面
html
<el-button @click="$router.go(0)" title="刷新" size="small" type="info" icon="el-icon-refresh"></el-button>
<el-button @click="$router.go(-1)" title="返回上一面" size="small" type="info" icon="el-icon-refresh"></el-button>
js
this.$router.go(-1); //返回上一页面
this.$router.push(supplyList/id/+this.supply_store_id); //跳转到指定页面
本文详细介绍了在Vue项目中如何使用a标签进行路由传参,以及如何实现页面的刷新、返回上一页和跳转至指定页面的功能。通过具体的HTML和JS代码示例,展示了Vue路由在实际开发中的应用。

5245

被折叠的 条评论
为什么被折叠?



