@aniyajs/plugin-router
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

基于 react-router V6 的路由插件

ANIYAJS-PLUGIN-ROUTER

官方文档

版本

  • 稳定版:npm package NPM downloads

启用 ✨

// 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',
    },
  ],
}

Package Sidebar

Install

npm i @aniyajs/plugin-router

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

11.2 kB

Total Files

9

Last publish

Collaborators

  • lbfdada