Open lq782655835 opened 5 years ago
目录结构保持一致,使得多人合作容易理解与管理,提高工作效率。Vue标准项目
main.js
router.js
plugins
pages
components
server
assets
utils
store
project └───src │ │ app.vue // 主页面 │ │ main.js // 主入口 | | router.js // 所有路由 │ │ │ |____assets // css、image、svg等资源 │ | |____css // 所有sass资源 | | | | reset.scss // 兼容各浏览器 | | | | global.scss // 全局css | | | | variable.scss // sass变量和function等 │ | |____img // image图标库 | | |____svg // svg图标库 | | | |____components // 组件 │ | |____common // common自注册组件 │ | |____base // 原子组件(如果是引入第三方,该文件夹可省略) │ | | ... // 业务公用组件 │ | |____entity // entity页面组件 │ | |____about // about页面组件 | | | |____pages // UI层(原则:轻page,重component) | | |____entity | | | | list.vue // 列表页 | | | | create.vue // 新增页 | | | | edit.vue // 修改页 | | | main.vue | | | |____plugins // 自己或第三方插件 | | | index.js // 插件入口文件 | | | directives.js // 所有Vue指令 | | | filters.js // 所有Vue过滤 | | | |____server // 接口层 | | | index.js // 所有接口 | | | http.js // axios二次封装 | | | |____store // vuex数据 | | | index.js | | | |____utils // 工具层 | | | config.js// 配置文件,包括常量配置 | └───public // 公用文件,不经过webpack处理 │ │ favicon.ico │ │ index.html │ vue.config.js // vue-cli3主配置 │ babel.config.js// babel配置 │ .eslintrc.js // eslint配置 │ .prettierrc.js // perttier配置 │ package.json // npm配置 │ README.md // 项目说明
目录结构保持一致,使得多人合作容易理解与管理,提高工作效率。Vue标准项目
简要说明
main.js
主入口,router.js
路由划分plugins
自己或第三方插件,包括但不限于components、directives、filters、third libpages
所有路由页面。原则:轻page,重componentcomponents
所有组件。包括原子组件、业务公用组件、页面独有组件server
api引入入口assets
sass、图片资源入口,不常修改数据utils
工具文件夹store
标准vuex格式,非必须详细说明