tb-auto-router
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

介绍

自动导入路由, 自动检索文件

安装

# 启动服务
npm install tb-auto-router
# 构建测试服生产环境
yarn add tb-auto-router
# 构建正式服生产环境
pnpm install tb-auto-router

说明

可使用环境, vue3, vite

例子

webpack 中使用

import autoRouter from "tb-auto-router";
const options = {
	startIndex: 10,
}
const routes = autoRouter(options)

vite 中使用

import autoRouter from "tb-auto-router";
const options = {
	startIndex: 10,
}
const routes = autoRouter(options)

备注

// 待完成-支持传入检索路径 // 待完成-支持生成的 path 从哪一层开始为开始路径 // 待完成-支持返回自定义格式参数, 并设置默认值 // 待完成-支持返回一维数据格式路由还是嵌套数组的路由格式

umd:打包后代码很紧凑、体积小,但是不易读; es:打包后的代码和我们写的代码很像,易读,但是体积大。

Readme

Keywords

none

Package Sidebar

Install

npm i tb-auto-router

Weekly Downloads

15

Version

1.3.1

License

ISC

Unpacked Size

5.48 kB

Total Files

5

Last publish

Collaborators

  • tb543457309