# vue-quick-admin **Repository Path**: yakima/vue-quick-admin ## Basic Information - **Project Name**: vue-quick-admin - **Description**: 关注项目产物大小和访问体验的、基于Vue的后台管理系统。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-30 - **Last Updated**: 2021-08-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-quick-admin 基于vue的后台管理系统。 ## 环境 node v14.15.5 npm 6+ ## 常用命令 ```json5 { "scripts": { "dev": "vite", // start dev server "build": "vite build", // build for production "serve": "vite preview" // locally preview production build } } ``` ## 注意事项 ### 环境变量 vite项目里环境变量都是从`import.meta.env`对象上取的,有下面这些内置对象: - `import.meta.env.MODE`: {string} the mode the app is running in. - `import.meta.env.BASE_URL`: {string} the base url the app is being served from. This is determined by the base config option. - `import.meta.env.PROD`: {boolean} whether the app is running in production. - `import.meta.env.DEV`: {boolean} whether the app is running in development (always the opposite of `import.meta.env.PROD`) 在PROD环境下,代码里的这些环境变量值都是直接根据字符串来匹配替换的,所以不能通过`import.meta.env[key]`这种动态key的方式拿到值。 ### history模式 本项目中用的是vue-router4的history模式,并非hashHistory模式,如果要用hashHistory模式,把路由设置代码里的`createWebHistory`换成`createWebHashHistory`即可。 history模式本地开发时开发工具已支持刷新。生产环境如不支持需要对应地进行配置。具体见[https://next.router.vuejs.org/guide/essentials/history-mode.html#html5-mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#html5-mode)。 nginx的配置如下: ```bash location / { try_files $uri $uri/ /index.html; } ``` ## Apple M1兼容问题处理方案 使用nvm直接安装的v14.15.5执行项目会报错,需要卸载后按下面的方式重新安装。 ```bash nvm uninstall 14 arch -x86_64 zsh nvm install 14 nvm alias default 14 ```