Skip to content

脚手架创建项目

创建 Vue2

详细用法请参考本站 示例

安装 vue CLI

bash
npm install -g @vue/cli --registry=https://registry.npmmirror.com

查看 vue 版本

bash
vue --version

创建名为 test1 项目,手动选择组件模式并选择 vue2

bash
vue create test1

安装项目依赖

bash
npm install

开发模式运行项目

bash
npm run serve

创建 Vue3

详细用法请参考本站 示例

安装 vue CLI

bash
npm install -g @vue/cli --registry=https://registry.npmmirror.com

查看 vue 版本

bash
vue --version

创建名为 test1 项目,手动选择组件模式并选择 vue3

bash
vue create test1

安装项目依赖

bash
npm install

编译 vue 项目

bash
npm run build

开发模式运行项目

bash
npm run serve