Fork me on GitHub

Vue Vue-Router params 传参 为空 path定义参数 参数 param is not repeatable

我在Vue-Router4.0.3版本上出现这个问题
因为官方 在2022年8月22日时废除了未定义的传参方式,所以必须使用定义的params。
解决办法:
在配置路由时:path路径上带上传值的key值。比如这样:
path:"/Authority:id/:authority*"
那么params:{
id:1,
authority:[1,2]
}
这里的authority是数组,要在path上这样写。
posted @ 2022-12-10 15:50  HelloLLLLL  阅读(757)  评论(1编辑  收藏  举报