動態路由跳轉

  1. push傳字符串 ,也能夠傳對象 this.$router.push('/heroes/edit')
  2. this.$router.push({name:'路由名稱',params:{})
  3. 須要在路由定義中指定name,而且匹配規則也必須改變 {path:'/luyo/:id',name:'路由名稱',component:組件}
相關文章
相關標籤/搜索