How to use the omi-router.init function in omi-router

To help you get started, we’ve selected a few omi-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AlloyTeam / omi-cli / template / spa / src / component / hello / index.js View on Github external
install(){
        OmiRouter.init({
            routes: [
                {path: '/about', component: () => import("../intro/index.js")}
            ],
            renderTo: "#view",
            defaultRoute: '/',
            root: this
        })
    }
github Tencent / omi / pr / example / spa / src / main.js View on Github external
install() {
        OmiRouter.init({
            routes: [
                {path: '/', component: Home},
                {path: '/about', component: About},
                {path: '/user-list', component: UserList},
                {path: '/user/:name/category/:category', component: User}
            ],
            renderTo: "#view",
            defaultRoute: '/',
            root: this
        })
    }

omi-router

Router for Omi

MIT
Latest version published 6 months ago

Package Health Score

75 / 100
Full package analysis

Popular omi-router functions