vue项目实战:项目搭建使用vue+Es6+webpack+vuex+axios+Element ui完成 文件夹内容的确定
该项目为vue-cli 2.9.6版本就是 vue2.x版本的demo项目汇集常用语法常用插件ui库的结合使用注意的点 搭建项目的流程不在赘述
以项目的维度去思考整个项目的架构和舍去优化的东西!尽量代码简洁易懂 可扩展 易维护
# vue-elementui
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
D:.
├─build
├─config 项目配置
├─src
│ ├─api api(axios封装 接口封装)
│ ├─assets
│ │ ├─basecss 样式
│ │ └─img 图片
│ ├─common 公共js
│ ├─commonComp 公共全局组件
│ ├─components 公共组件文件夹
│ │ ├─Breadcrumb 面包屑
│ │ └─layout 布局
│ ├─directives 自定义指令
│ ├─filters 过滤器方法
│ ├─mixins 公共逻辑
│ ├─page 页面
│ │ ├─404
│ │ ├─baiduMap
│ │ ├─dashboard
│ │ ├─login
│ │ ├─usualElementStudy
│ │ └─vueStudy
│ ├─router 路由文件
│ ├─store 仓库
│ │ └─modules
│ └─util 工具类方法
├─static 静态资源
└─test
├─e2e
│ ├─custom-assertions
│ └─specs
└─unit
└─specs
tree命令的常用指令:
1、 tree -A 显示所有文件和目录;
2、tree -C 在文件和目录清单加上色彩,便于区分各种类型。
2、 tree -D 只显示文件夹;
3、tree -L n 显示项目的层级。n表示层级数。比如想要显示项目三层结构,可以用tree -l 3;
4、tree -I pattern 用于过滤不想要显示的文件或者文件夹。比如你想要过滤项目中的node_modules文件夹,可以使用tree -I "node_modules";
5、tree > tree.md 将项目结构输出到tree.md这个文件。
package.json文件
{
"name": "vue-elementui",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"build": "node build/build.js",
"analyz": "NODE_ENV=production npm_config_report=true npm run build"
},
"dependencies": {
"axios": "^0.19.2",
"babel-polyfill": "^6.26.0",
"driver.js": "^0.9.8",
"echarts": "^4.8.0",
"element-ui": "^2.13.2",
"es6-promise": "^4.2.8",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"vue": "^2.5.2",
"vue-baidu-map": "^0.21.22",
"vue-pdf": "^4.1.0",
"vue-router": "^3.0.7",
"vuex": "^3.5.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"nightwatch": "^0.9.12",
"node-notifier": "^5.1.2",
"node-sass": "^4.14.1",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"sass-loader": "^7.3.1",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
以上代码本人项目实测!!!真实可靠,请勿随意转载~转载请注明出处~~~谢谢合作!