You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
对 beforeEnter, beforeLeave 等钩子的回调函数增加 from, to 的访问
增加 title 选项,自动改变 document.title
增加 this.current 访问当前的路由信息
constroutes={"/": {"name": "home","controllers": [homeController],"sub": {"/product": {"name": "productList","beforeLeave": [doBeforeLeave],// callbacks which will run before switching to another route"controllers": [productController1,productController2],"beforeEnter": [doAfterEnter],// callbacks which will run after all controllers execute"data": {"custom": "data"}},"/product/list": {"redirect": "/product"},"/product/:id": {"name": "productDetail","controllers": productDetailController},"/product/detail/:id": {"redirect": {"name": "productDetail"}},"/parent": {"forward": true,"controllers": parentController,"sub": {"/child": {"controllers": childController// will fired after parentController}}},"*": {"name": "pageNotFound","controllers": []}}}};Router.mode('hashbang');constconfigs={mode: "hashbang",// default: hashbangbeforeEachEnter: [],beforeEachLeave: []};constmyRouter=newRouter(routes,configs);myRouter.start();