两个vue之间带参数数据跳转
2025-04-13 00:33:56 187浏览
两个vue之间带参数数据跳转


传id的时候就是修改

注意路由
{
path: '/addTopic/:topicId?',
name: 'addTopic',
component: commonView,
children: [{ path: '', component: AddTopicView }]
},
toUpdate(row){
let topicId=row.id
this.$router.push(`/addTopic/${topicId}`)
},新增的时候跳转
onAdd(){
this.$router.push("/addTopic")
},跳转之后的处理
created() {
var topicId=this.$route.params.topicId;
if(topicId){
getTopic(topicId).then(res =>{
console.log(res);
this.ruleForm=res.data
})
} else {
// 重置表单为初始状态
this.ruleForm = {
topicName:'',
topicDesc: '',
typeId: '',
file: ''
}
}
}
好博客就要一起分享哦!分享海报
此处可发布评论
评论(0)展开评论
暂无评论,快来写一下吧
展开评论
您可能感兴趣的博客
他的专栏
他感兴趣的技术

新业务
springboot学习
ssm框架课
vue学习
【带小白】java基础速成