## 初始化项目 ```shell npm init -y ``` ## 选择打包编译工具 webpack vite(新项目个人推荐) ## 选择技术栈(推荐使用typescript) vue 3 、vue-router 、axios/fetch 、pinia 、dayjs ## 安装依赖 ```shell npm install vue vue-router pinia dayjs yarn add vue vue-router pinia dayjs pnpm install vue vue-router pinia dayjs # 安装 ts的依赖 npm install vite @vitejs/plugin-vue typescript vue-tsc yarn add -D vite @vitejs/plugin-vue typescript vue-tsc pnpm install vite @vitejs/plugin-vue typescript vue-tsc ``` ## html模板 ```html Title
``` ## main.ts ```ts import {createApp, defineComponent} from 'vue'; const App = defineComponent({ template: `

vue + vite

` }) const app = createApp(App) app.mount('#vue-root-app') ``` ## package.json的配置 ```json { "name": "admin-fe", "version": "1.0.0", "description": "积分系统管理端", "scripts": { "start": "npm run dev", "dev": "vite", "build": "vue-tsc && vite build" }, ... } ``` ## vite的配置 ```js import vue from '@vitejs/plugin-vue' export default { // 必须配置vue插件 plugins: [vue()] } ```