将路由封装到 router.js中

  1. 封装到路由后的方法,可以通过router.方法名或者router['方法名']的方式实现调用,后者可以传递变量

image.png
image.png
image.png