具體方法如下:
1.通過query獲取路由參數
#配置路由<router-link :to="{ name:'login',query:{id:1} }">登錄</router-link>#獲取路由參數this.$route.query
<router-link :to="{ name:'login',query:{id:1} }">登錄</router-link>
#獲取路由參數
this.$route.query
2.通過params獲取路由參數
#配置路由<router-link :to="{ name:'register',params:{'name':'San'} }">注冊</router-link>#獲取路由參數this.$route.params
<router-link :to="{ name:'register',params:{'name':'San'} }">注冊</router-link>
this.$route.params
億速云公眾號
手機網站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權所有
廣州億速云計算有限公司粵ICP備17096448號-1 粵公網安備 44010402001142號增值電信業務經營許可證編號:B1-20181529