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上這樣寫。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章