命令行界面,创建项目
> npm create vue@latest
项目创建成功后,会有一系列选项,主要是类似TypeScript等插件的选择,学习期可以全部选否,有需要再添加即可。
✔ Project name: … <your-project-name>
✔ 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? … No / Cypress / Playwright
✔ Add ESLint for code quality? … No / Yes
✔ Add Prettier for code formatting? … No / Yes
Scaffolding project in ./<your-project-name>...
Done.
安装依赖,及启动服务器
> cd <your-project-name>
> npm install
> npm run dev
成功后如图所示: