考虑一下:
this.$root.$router.push({
path: '/dashboard',
params: { errors: 'error' },
query: { test: 'test' }
})
我在组件中使用它来重定向到另一个URL,并且发生了一些错误。问题是,当我要访问params
仪表板组件中的字段时,该字段为空。该query
领域运作良好。我正在尝试通过访问它this.$route.params.errors
。
$ router.push中的Params字段为空
考虑一下:
this.$root.$router.push({
path: '/dashboard',
params: { errors: 'error' },
query: { test: 'test' }
})
我在组件中使用它来重定向到另一个URL,并且发生了一些错误。问题是,当我要访问params
仪表板组件中的字段时,该字段为空。该query
领域运作良好。我正在尝试通过访问它this.$route.params.errors
。
第2175篇《$ router.push中的Params字段为空》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
相似问题
问题类别