- 准备 node.js
- 准备vue脚手架,下载淘宝镜像
- 安装 axios 以便发送ajax请求
- 安装element-plus
- 安装router
npm init vite@latest demo_fe -- --template vue
cd demo_fe
cnpm install
cnpm install axios --save
cnpm install element-plus --save
cnpm install vue-router@4 --save
cnpm install vuex@next --save
cnpm run dev
- 配置 main.js
- 使用 vue-router 管理页面路径
- 使用 vuex 管理数据
- 使用 axios 统一封装请求
如果不写 -- save
则安装的依赖无法写到 package.json 中