网上千奇百怪都有,基本都有一套自己的理解。初学者可以看官方的vue-cli template介绍:Project Structure . ├── build/ # webpack config files │ └── ... ├── config/ │ ├── index.js # main project config │ └── ... ├── src/ │ ├── main.js # app entry file │ ├── App.vue # main app component │ ├── components/ # ui components │ │ └── ... │ └── assets/ # module assets (processed by webpack) │ └── ... ├── static/ # pure static assets (directly copied) ├── test/ │ └── unit/ # unit tests │ │ ├── specs/ # test spec files │ │ ├── index.js # test build entry file │ │ └── karma.conf.js # test runner config file │ └── e2e/ # e2e tests │ │ ├── specs/ # test spec files │ │ ├── custom-assertions/ # custom assertions for e2e tests │ │ ├── runner.js # test runner script │ │ └── nightwatch.conf.js # test runner config file ├── .babelrc # babel config ├── .postcssrc.js # postcss config ├── .eslintrc.js # eslint config ├── .editorconfig # editor config ├── index.html # index.html template └── package.json # build scripts and dependencies You will notice in the project structure we have two directories forstatic assets: src/assets and static/. 你会注意到上述项目结构有两个静态资源目录:src/assets 和 static/注:前者会被当作webpack的模块,后者会原封不动复制到build目录What is the difference between them? 使用vuex的(一个专为 Vue.js 应用程序开发的状态管理模式)项目结构 ├── index.html ├── main.js ├── api │ └── ... # 抽取出API请求 ├── components │ ├── App.vue │ └── ... └── store ├── index.js # 我们组装模块并导出 store 的地方 ├── actions.js # 根级别的 action ├── mutations.js # 根级别的 mutation └── modules ├── cart.js # 购物车模块 └── products.js # 产品模块
$ tree src -L 1 src |-- api |-- components |-- config |-- directives |-- entry |-- filters |-- fonts |-- images |-- libs |-- sass |-- store |-- template |-- utils `-- views
网上千奇百怪都有,基本都有一套自己的理解。
初学者可以看官方的
vue-cli template
介绍:Project Structure
使用vuex的(一个专为 Vue.js 应用程序开发的状态管理模式)项目结构