1.0.16 • Published 3 years ago
vue-environment-setup v1.0.16
vue-environment-setup
简介
vue-environment-setup
用于Vue项目自动化创建,依赖于:
环境
Node (version >= 14.x)
安装
npm install vue-environment-setup -g
运行
ves
生成路由
- 默认路由文件路径:src/routes/index.tsx
- 自定义路由文件路径:使用package.json中routes字段指向路由文件路径
- 自定义配置模版目录:使用package.json中template字段指向模版目录,目录下必须存在三个文件:index.tsx、table.tsx、service.tsx
- 在路由文件中添加路由,内容如:
{ path: '/parent', name: '父级路由中文名称', icon: 'smile', routes: [ { path: '/parent/child', name: '子级路由中文名称', component: './Parent/Child', table: true, // 是否是一体化表格组件 service: true, // 是否添加service文件 cover: true, // 已有文件是否覆盖 } ] }
- 运行命令
ves router