@aniyajs/plugin-router
v1.0.5
Published
基于 react-routerV6 封装的路由插件服务于aniyajs自动化脚手架
Downloads
5
Readme
基于 react-router V6 的路由插件
版本
启用 ✨
// config.ts
{
// ...
routes:[], // 默认为[],数组为开启
aniyaPlugins: ['@aniyajs/plugin-router'],
}
属性
name
:名称,Type:String
path
:路由地址,Type:String
redirect
:重定向,Type:String
routes
:子路由,Type:IRoute[] | []
component
:相对于src/pages
的相对文件地址,Type:String
栗子 🌰
// config.ts
{
// ...
aniyaPlugins: ['@aniyajs/plugin-router'],
routes:[
{ path: '/', redirect: '/home' },
{
path: '/',
component: '../layouts/SecurityLayout',
routes: [
{
path: '/home',
component: './home'
},
]
},
{
component: './404',
},
],
}