{"id":15184916,"url":"https://github.com/zhoukaiyue/vue2-pc-tmp","last_synced_at":"2026-02-01T01:05:56.951Z","repository":{"id":250806324,"uuid":"835531315","full_name":"zhoukaiyue/vue2-pc-tmp","owner":"zhoukaiyue","description":"\"vue2-pc-tmp\" 是基于 Vue2.7 + VueCli5 + Vuex + Vant2 + sass + axios（封装）+ Eslint + Prettier + dayJs + tailwindcss 等流行技术栈构建的 PC 端模板脚手架，开箱即用。","archived":false,"fork":false,"pushed_at":"2024-07-30T03:36:25.000Z","size":366,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T15:51:40.789Z","etag":null,"topics":["elementui","pc","template","vue2"],"latest_commit_sha":null,"homepage":"https://demo.127516.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhoukaiyue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T03:10:39.000Z","updated_at":"2024-07-31T10:51:25.000Z","dependencies_parsed_at":"2024-07-30T07:25:26.292Z","dependency_job_id":null,"html_url":"https://github.com/zhoukaiyue/vue2-pc-tmp","commit_stats":null,"previous_names":["zhoukaiyue/vue2-pc-tmp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zhoukaiyue/vue2-pc-tmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhoukaiyue%2Fvue2-pc-tmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhoukaiyue%2Fvue2-pc-tmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhoukaiyue%2Fvue2-pc-tmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhoukaiyue%2Fvue2-pc-tmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhoukaiyue","download_url":"https://codeload.github.com/zhoukaiyue/vue2-pc-tmp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhoukaiyue%2Fvue2-pc-tmp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28963225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T00:42:38.011Z","status":"ssl_error","status_checked_at":"2026-02-01T00:42:35.920Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elementui","pc","template","vue2"],"created_at":"2024-09-27T17:42:26.198Z","updated_at":"2026-02-01T01:05:56.938Z","avatar_url":"https://github.com/zhoukaiyue.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 简介\n\n\"vue2-pc-tmp\" 是基于 Vue2.7 + VueCli5 + Vuex + Vant2 + sass + axios（封装）+ Eslint + Prettier + dayJs + tailwindcss 等流行技术栈构建的 PC 端模板脚手架，开箱即用。\n\n## 原子化 CSS 支持 - Tailwindcss\n\n本项目支持原子化 CSS，我们选择使用 [Tailwindcss](https://www.tailwindcss.cn/docs/installation)。Tailwindcss 是一个高度可定制的，低层级的 CSS 框架，它提供了丰富的预设类，使得开发者可以快速地构建现代化的用户界面。使用 Tailwindcss，你可以在 HTML 中直接引用预设类，而无需在 CSS 文件中编写大量的样式代码。\n\n## 环境要求\n\n-   node ^14.17.0 || \u003e=16.0.0\n-   pnpm \u003e=7\n\n## 编辑器以及对应扩展\n\n-   Visual Studio v69+\n-   Vetur v0.35.0+\n-   Eslint v2.2.6+\n-   Prettier - Code formatter v9.5.0+\n\n## 快速开发\n\n```\n#通过 npm 安装 pnpm (如果本地已安装pnpm,请忽略)\nnpm install -g pnpm\n#安装项目依赖\npnpm install\n#开发环境启动\npnpm start\n#打包 test 环境代码\npnpm build:test\n#打包生产环境代码\npnpm build or pnpm build:prod\n#执行 js 类型检查\npnpm lint:fix\n#执行 prettier 批量格式化代码\npnpm lint:prettier\n\n##注：详细请阅读package.json 以及对应的环境配置文件（即.env 文件）！\n```\n\n```text\n同时在项目根目录下包含一个 run.bat，该文件会列出所有 package.json 中 script 块里面的所有命令，\n通过双击该文件，你可以在命令行中输入相应的序号并按 Enter 键，程序将运行你选择的脚本。\n```\n\n## 开发基础规范\n\n-   🚀 重要、复杂逻辑一定要写注释；\n-   🚀 代码规范按照 eslint 的规则来，做到 no waring 和 no error；\n-   🚀 项目业务开发，优先使用 vue 全家桶技术栈开发项目，预编译使用 sass；\n-   🚀 操作成功或失败后要有提示，比如新增成功、新增失败运行时间长的任务（计算量大、请求后台接口），要有 loadding 效果；\n-   🚀 vue 单文件组件代码规范，html、script、style 的位置顺序 html \u003e script \u003e style；\n-   🚀 公共的状态才放到 store；\n-   🚀 代码尽量往纵向发展，一行不要太长；\n-   🚀 不要在钩子函数中写大量业务代码；\n-   🚀 异步使用 aysnc await 语法；\n-   🚀 不是常用的方法不要全局挂载；\n-   🚀 文件命名如果是多单词则采用驼峰命名或者烤肉串大小写，尽量简洁明了；\n\n### 基础组件名。 【注：src/resources/components 目录。】\n\n\u003e 基础组件文件命名应该以 base 为前缀命名，以示其唯一性，并且以横线连接。\n\n```\n例子：\nsrc\n└─ resources\n   └─ components\n      └─ base-list\n         ├─ index.vue      //源码\n         └─ README.md      //组件使用说明文档\n```\n\n### 业务组件名。 【注：src/views/components 目录。】\n\n\u003e 业务组件文件命名应该以 the 为前缀命名，以示其唯一性，并且以横线连接。\n\n```\n例子：\nsrc\n└─ views\n   └─ components\n      └─ the-button\n         ├─ index.vue      //源码\n         └─ README.md      //组件使用说明文档\n```\n\n### 路由文件创建与命名。 【注：src/config/router 目录。】\n\n为了方便维护与开发，建议路由文件命名与对应的页面文件命名保持一致，尽量简洁明了。\n\n```\n例子：\nsrc\n└─ config\n   └─ router\n      └─ dev.js\n```\n\n### 接口文件创建与命名。 【注：src/config/apis 目录。】\n\n为了方便维护与开发，建议接口文件命名与对应的页面文件命名保持一致，尽量简洁明了。\n\n```\n例子：\nsrc\n└─ config\n   └─ apis\n      └─ dev.js\n```\n\n### 状态切片文件创建与命名。 【注：src/config/store 目录。】\n\n为了方便维护与开发，建议以当前对应模块或者功能命名文件夹，尽量简洁明了。\n\n```\n例子：\nsrc\n└─ config\n   └─ store\n      └─ dev\n         └─ index.js\n```\n\n### 图片资源。 【注：src/assets/img 目录。】\n\n建议图片文件夹命名与对应的页面文件命名保持一致，公共图片资源放置到 src/assets/img/base 目录下即可。\n\n```\n例子：\nsrc\n└─ assets\n   └─ img\n```\n\n## git 版本规范\n\n### 分支管理\n\n一般项目分主分支（master）和其他分支。 当有团队成员要开发新功能(Feather)或改 BUG(Fix) 时，就从 master 分支开一个新的分支。\n\n### Commit 规范\n\n-   feat 新增功能\n-   fix 修复 bug\n-   docs 文档变更\n-   style 代码格式（不影响功能，例如空格、分号等格式修正）\n-   refactor 代码重构\n-   perf 改善性能\n-   test 测试\n-   build 变更项目构建或外部依赖（例如 scopes: webpack、gulp、npm 等）\n-   ci 更改持续集成软件的配置文件和 package 中的 scripts 命令，例如 scopes: Travis, Circle 等\n-   chore 变更构建流程或辅助工具\n-   revert 代码回退\n\n### Tag 版本号\n\n版本号以 v 开头，根据当前仓库的 tag 编号进行累加，如：v1.10.45。\n\n## 项目目录说明\n\n```\nvue2-pc-tmp                                 // 项目根目录\n├─ .browserslistrc                          // 浏览器兼容性配置文件\n├─ .env.development                         // 开发环境变量\n├─ .env.production                          // 生产环境变量\n├─ .env.test                                // 测试环境变量\n├─ .eslintignore                            // ESLint 忽略配置\n├─ .eslintrc.js                             // ESLint 配置文件\n├─ .npmrc                                   // npm 配置文件\n├─ .prettierrc.js                           // Prettier 配置文件\n├─ .vscode                                  // VSCode 配置文件夹\n│  └─ settings.json                         // VSCode 设置\n├─ babel.config.js                          // Babel 配置文件\n├─ cleanCache.js                            // 清理缓存脚本\n├─ jsconfig.json                            // JS 配置文件\n├─ lint-staged.config.js                    // lint-staged 配置文件\n├─ package.json                             // npm 包配置文件\n├─ pnpm-lock.yaml                           // pnpm 锁文件\n├─ postcss.config.js                        // PostCSS 配置文件\n├─ public                                   // 公共文件夹\n│  ├─ index.html                            // 入口 HTML 文件\n│  └─ static                                // 静态资源文件夹\n├─ README.md                                // 项目说明文件\n├─ src                                      // 源代码文件夹\n│  ├─ App.vue                               // 主 Vue 组件\n│  ├─ assets                                // 资源文件夹\n│  │  ├─ css                                // CSS 文件夹\n│  │  └─ img                                // 图片文件夹\n│  ├─ config                                // 配置文件夹\n│  │  ├─ apis                               // API 文件夹\n│  │  ├─ router                             // 路由配置文件夹\n│  │  └─ store                              // Vuex store 文件夹\n│  ├─ layout                                // 布局组件文件夹\n│  ├─ main.js                               // 项目入口文件\n│  ├─ packages                              // 包文件夹\n│  │  ├─ request                            // 请求文件夹\n│  │  ├─ router                             // 路由文件夹\n│  │  └─ store                              // Vuex store 文件夹\n│  ├─ resources                             // 资源文件夹\n│  │  ├─ components                         // 组件文件夹\n│  │  ├─ directive                          // 指令文件夹\n│  │  └─ plugin                             // 插件文件夹\n│  ├─ utils                                 // 工具函数文件夹\n│  │  ├─ helper                             // 辅助函数文件夹\n│  │  └─ tools                              // 工具函数文件夹\n│  └─ views                                 // 视图组件文件夹\n├─ tailwind.config.js                       // Tailwind CSS 配置文件\n├─ util.js                                  // 工具函数文件\n├─ vue.config.js                            // Vue CLI 配置文件\n└─ 常见问题.md                               // CLI常见问题文档\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhoukaiyue%2Fvue2-pc-tmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhoukaiyue%2Fvue2-pc-tmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhoukaiyue%2Fvue2-pc-tmp/lists"}