3.vue-router-传递参数问题($route)
(1)this. r o u t e r 和 t h i s . router 和 this. router和this.route 的区别:
this.$router
相当于一个全局的路由对象,包含路由相关的属性、对象 (如 history 对象) 和方法,在任何页面都可以通过this.$router
调用其方法如push()
、go()
、resolve()
等。this.$route
表示当前的路由对象。每一个路由都有一个route
对象,它是一个局部的对象,可以获取当前路由对应的name
,params
,path
,query
等属性。