Vue如何获取当前页面的url及参数
注意:在视图层使用把this去掉,使用“Mustache”语法 (双大括号) 的文本插值如:{{$route.params.id}}完整路径:window.location.href路由路径:this.$route.path路由路径参数this.$route.params/user/:id → /user/12this.$route.params.id;//12...
   ·  
 注意:在视图层使用把this去掉,使用“Mustache”语法 (双大括号) 的文本插值
  如:{{$route.params.id}}
  完整路径:
 window.location.href
路由路径:
 this.$route.path
路由路径参数
  this.$route.params
  /user/:id → /user/12
this.$route.params.id;//12 
更多推荐
 
 



所有评论(0)