Fe-interview: [vue] route和router有什么区别?

Created on 20 Jun 2019  ·  4Comments  ·  Source: haizlin/fe-interview

[vue] route和router有什么区别?

vue

Most helpful comment

route:代表当前路由信息对象,可以获取到当前路由的信息参数
router:代表路由实例的对象,包含了路由的跳转方法,钩子函数等

All 4 comments

route代表当前路由对象,router代表整个vue实例下的路由对象

router是new vueRouter的实例,route是当前路由的对象

rorute 它是一条路由, ,routes只是配置了一组路由, router 是一个机制 相当于管理者 ,用来管理路由 ,我是这么认为的 不知道对不对

route:代表当前路由信息对象,可以获取到当前路由的信息参数
router:代表路由实例的对象,包含了路由的跳转方法,钩子函数等

Was this page helpful?
0 / 5 - 0 ratings