1.0.5 • Published 27 days ago

@aniyajs/plugin-router v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
27 days ago

基于 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',
    },
  ],
}
1.0.5

27 days ago

1.0.4

27 days ago

1.0.3

1 month ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago