@joker.front/router
v1.0.33
Published
Joker Front Router 路由管理
Downloads
104
Readme
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;
}
}