使用create-vue创建项目
1.前提环境条件已安装16.0或更高版本的Node.js
2.创建一个vue3应用
C:\Users\lcds\pro\vue3-test>npm init vue@latest
Need to install the following packages:
create-vue@3.7.1
Ok to proceed? (y) y
Vue.js - The Progressive JavaScript Framework
√ Project name: ... vue3-test
√ Add TypeScript? ... No / Yes
√ Add JSX Support? ... No / Yes
√ Add Vue Router for Single Page Application development? ... No / Yes
√ Add Pinia for state management? ... No / Yes
√ Add Vitest for Unit Testing? ... No / Yes
? Add an End-to-End Testing Solution? » - Use arrow-keys. Return to submit.
> No
Cypress
Nightwatch
Playwright
√ Add ESLint for code quality? ... No / Yes
√ Add Prettier for code formatting? ... No / Yes
Scaffolding project in C:\Users\lcds\pro\vue3-test\vue3-test...
Done. Now run:
cd vue3-test
npm install
npm run dev
3.进入项目,启动应用
C:\Users\lcds\pro\vue3-test>cd vue3-test
C:\Users\lcds\pro\vue3-test\vue3-test>npm install
added 462 packages in 34s
C:\Users\lcds\pro\vue3-test\vue3-test>npm run dev
> vue3-test@0.0.0 dev
> vite
VITE v4.3.9 ready in 1550 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
在浏览器中输入 http://localhost:5173/ 出现如下图,表示已经成功创建vue3应用