VUE 错误:导航时丢弃无效参数“recordIds”、“datasources”

问题描述 投票:0回答:1

在 Vue 中,我在将参数从一条路线传递到另一条路线时遇到问题。 这就是我的目标路线:

{
   path: '/record-modification',
   name: 'recordModification',
   component: recordModification,
   meta: { needAuthentication: true, needCaseId: true }
}

这就是我将数据推送到路由的方式:

this.$router.push({
     name: 'recordModification',
     params: {
         recordIds,
         datasources
     }
});

但是在目标页面上,当我尝试访问 this.$route.params 时,我得到一个空对象。知道我在这里做错了什么吗?

javascript vue.js vue-component vue-router
1个回答
0
投票

在此代码中使用查询更改参数,并且当您也调用“recordModification”中的参数时:

这个。$router.push({ name: '记录修改', 询问: { 记录ID, 数据源 } });

© www.soinside.com 2019 - 2024. All rights reserved.