@joker.front/router
TypeScript icon, indicating that this package has built-in type declarations

1.0.28 • Public • Published

Joker 路由管理

@joker.front/router是 Joker 前端框架的核心路由组件。

如何使用

import { Router } from "@joker.front/router";

new Router({
    loggerLeve: "info",
    routes: [
        { path: "/", redirect: "/a" },
        {
            path: "/a",
            component: a,
            children: [
                { path: "", component: a1 },
                { path: "a2", component: a2 }
            ]
        }
    ]
});

在组件内可以通过读取router属性来获取路由信息或设置路由:

import { router } from "@joker.front/router";

export default class extends Component {
    test() {
        //跳转
        router.push({
            path: "b"
        });

        //返回
        router.back();

        //获取当前路由
        router.route.value;
    }
}

文档

官网

帮助文档

Readme

Keywords

Package Sidebar

Install

npm i @joker.front/router

Homepage

jokers.pub

Weekly Downloads

3

Version

1.0.28

License

MIT

Unpacked Size

147 kB

Total Files

16

Last publish

Collaborators

  • joker.zohar