1、vue 路由 如果傳遞 params 定義路由的時候是
/路由名稱:id
獲取的時候
this.$route.params.id
最后形如
/路由名稱/路由參數(shù)
傳參的時候
params:{ str1:str1, str2:str2 }2、如果傳遞query ?id=str.... 定義路由的時候直接是
/路由名稱
獲取的時候
this.$route.query.id
傳參的時候
data:{ str1:str1, str2:str2 }以上這篇淺談vue-router2路由參數(shù)注意的問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持武林網(wǎng)。
新聞熱點
疑難解答