【发布时间】:2019-11-26 22:18:12
【问题描述】:
在我的路由器链接中,我需要设置 id 参数,它附加在 Vue 检查中,但不附加在 URL 中。
<router-link
:to="{ name: 'app-gateway-airport', params: { id: slotProps.row.id } }"
class="mr-2 rounded border boder-button-border w-8 h-8 flex flex-row items-center justify-center cursor-pointer">
<delete-icon />
</router-link>
slotProps.row.id这个变量设置正确。
它没有在 URL 中附加 id 参数。
【问题讨论】:
-
你的路由配置是什么?
-
它的 nuxt js。 prasedTo() { if (this.skipParsing) { return this.to; } if (_.isString(this.to)) { return this.to; } 返回 this.localePath(this.to); }
-
您的路线名称似乎错误 - 如果您有
_id.vue组件,路线名称应以-id结尾。也编辑了我的答案。试试看。如果有帮助,请将我的答案标记为解决方案。如果没有,你需要给我更多的细节......
标签: vue.js vuejs2 vue-router