创建vue2/vue3项目
创建一个Vue2项目
## 安装Vue-Cli : npm install -g @vue/cli
// Vue CLI 4.x 需要 Node.js v8.9 或更高版本 (推荐 v10 以上)
vue --version // 检测版本是否正确
## 创建一个项目: vue create hello-world // hello-world 指的是项目名
Vue CLI官网: https://cli.vuejs.org/zh/guide/creating-a-project.html
创建一个Vue3项目
【基于Vue-cli创建】
## 查看@vue/cli版本,确保@vue/cli版本在4.5.0以上
vue --version
## 安装或者升级你的@vue/cli
npm install -g @vue/cli
## 执行创建命令
vue create vue_test
## 随后选择3.x
## Choose a version of Vue.js that you want to start the project with (Use arrow keys)
## > 3.x
## 2.x
## 启动
cd vue_test
npm run serve
【基于vite创建】 // 推荐
## 安装vite
npm create vite@latest
## 1.创建命令
npm create vue@latest
## 2.具体配置
## 配置项目名称
√ Project name: vue3_test
## 是否添加TypeScript支持
√ Add TypeScript? Yes
## 是否添加JSX支持
√ Add JSX Support? No
## 是否添加路由环境
√ Add Vue Router for Single Page Application development? No
## 是否添加pinia环境
√ Add Pinia for state management? No
## 是否添加单元测试
√ Add Vitest for Unit Testing? No
## 是否添加端到端测试方案
√ Add an End-to-End Testing Solution? » No
## 是否添加ESLint语法检查
√ Add ESLint for code quality? Yes
## 是否添加Prettiert代码格式化
√ Add Prettier for code formatting? No
原文地址:https://blog.csdn.net/qq_48701993/article/details/140648529
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!