# vite-vue3.0 **Repository Path**: raohuiyong/vite-vue3.0 ## Basic Information - **Project Name**: vite-vue3.0 - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-09 - **Last Updated**: 2024-06-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Demo ### 开发规范 #### 目录的命名规范 - 目录名全部使用小写,kebab-case形式命名,如果需要有多个单词表达,使用中划线连接。如new-page、components。 #### 文件的命名规范 文件的命名规范按照不同情况进行命名 1. 如果该文件是单文件组件/类,采用PascalCase形式命名,方便导入和使用。如TDesignSelect.vue 2. 如果该文件是目录下的主文件,采用 index 名称命名,方便导入。如 index.ts, index.vue 3. 如果该文件是接口定义文件,采用camelCase形式命名,方便区分文件关联性。如 list.ts 和 listModel.ts 4. 如果该文件是资源/样式文件,采用kebab-case形式命名。如 list.css 和 list-model.css #### 类及接口的命名规范 1. 类名全部使用大写驼峰,同时命名跟回文件命名。 2. 接口命名以大写 I 开头,代表 interface。如IOption。 ### 注意事项 **`使用 pnpm 进行安装本项目,提交代码请使用commit命令`** - node >= 16 - _**严格遵守项目提交规范(commitlint)**_ - 如果使用的是 Windows,则需要关闭行尾转换 `git config --global core.autocrlf input` - 由于项目使用`unplugin-vue-components`和`unplugin-auto-import`自动导入组件和模块功能,项目中的组件和变量声明**_不允许使用 Icon 结尾和 T 开头_**(主要是tdesign会导致自动导入错误) - 消息提示请引入 `import { MessagePlugin } from '@/utils/reset-message';`进行使用,**_不要直接使用内置 MessagePlugin 以及 $message _** ### 命令 - 启动本地开发环境(自带热启动) ```bash # install dependencies $ pnpm install # serve with hot reload at localhost:3000 $ pnpm dev # 启用本地mock,同时也会启用远程地址(mock接口都是以/mock开头的) $ pnpm dev:mock # build for production $ pnpm build # eslint检查 $ pnpm lint # eslint修复 $ pnpm lint:fix # stylelint检查 $ pnpm stylelint # stylelint修复 $ pnpm stylelint:fix # prettier检查 $ pnpm format # prettier修复 $ pnpm format:fix # 执行eslint修复、stylelint修复和prettier修复 $ pnpm fix # 启用 git hooks $ pnpm prepare # 启提交代码,请使用此方式进行代码提交!请使用此方式进行代码提交!请使用此方式进行代码提交! $ pnpm commit ``` ### 兼容性 | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | | Edge ≥84 | Firefox ≥83 | Chrome ≥84 | Safari ≥14.1 | ### 项目部署 1. 项目使用[history 模式](https://router.vuejs.org/zh/guide/essentials/history-mode.html#%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E4%BE%8B%E5%AD%90),需要进行后端配置(已默认配置 Apache 方案)