使用路由传参时,query与params的区别!

query 

  1:参数会在地址栏显示

  2:参数不需要在路由的path后接:args1/:args2

  3:获取参数用this.$route.query.args1

params

  1:参数需要在路由的path后接:args1/:args2

  2:获取参数用this.$route.params.args1

猜你喜欢

转载自www.cnblogs.com/erfsfj-dbc/p/10084379.html
今日推荐