# 前端脚手架

Vue3 项目前端脚手架,支持:

  • uni-app 项目
  • uni-app,PC 管理端
  • uni-app,H5 移动端

# 如何使用

安装:

pnpm add net-cli -g

命令行使用,新建工程:

# Vue3
net-cli init my-project --vueVersion vue3

# Vue3 uni-app
net-cli init my-project --vueVersion vue3-cross

命令行使用,新建子工程:

# Vue3 H5
net-cli initSubProject sub-project --type h5 --vueVersion vue3

# Vue3 PC 管理端
net-cli initSubProject sub-project --type admin --vueVersion vue3

# Vue3 uni-app
net-cli initSubProject sub-project --vueVersion vue3-cross

脚本中使用:

const { initProject, initSubProject } = require('net-cli');

initProject({
  downloadPath: process.cwd(),
  vueVersion: 'vue3',
});

initSubProject({
  subProjectName: 'user',
  downloadPath: process.cwd(),
  type: 'h5',
  vueVersion: 'vue3',
});

# 类型

export type VueVersion = 'vue3-cross' | 'vue3';

export type SubProjectType = 'admin' | 'h5' | 'tgs';

export interface InitVue3Options {
  downloadPath: string;
  vueVersion: VueVersion;
}

export interface InitSubProjectOptions {
  subProjectName: string;
  downloadPath: string;
  vueVersion: VueVersion;
  type?: SubProjectType;
}

# 更新日志

点此查看

Last Updated: 2025/4/18 01:30:08