$ router.push中的Params字段为空

vue.js Vue.js

MonsterKK梅

2020-03-18

考虑一下:

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)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android