8000 GitHub - allenliu6/fe-router: simply frontend router library
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

allenliu6/fe-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fe-router

仿前端路由轮子

主逻辑在router.js 中,其他文件为辅助展现测试逻辑

两种模式,hash history

预期接口

{ mode: 'history', routes: [{ path: '/', name: 'home', container: '#app', component: home, hooks: {

    }
},
{
    path: '/home',
    name: 'home',
    container: '#app',
    component: home,
    hooks: {},
    children: [{
        path: '/hello',
        name: 'hello',
        container: '#hello',
        component: hello,
        hooks: {},
    }]
}]

}

TODO:

  1. 规范地址形式,支持多级地址
  2. 加入生命周期,设置相应钩子

About

simply frontend router library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0