普通的搭建方式(安装指令)
安装Node.js
- 检查node是否已安装,终端输入 node-v
会使用命令行(安装)
- npm install vue-cli - 首先安装 vue-cli
- vue init webpack - 创建项目
- npm install - 安装依赖
- npm install axios - 安装axios请求
- npm install vuex --save - 安装 vuex
- npm install vue-router - 安装路由
- npm install karma - 安装单元测试的环境
- npm install jquery --save-dev - 第三方库
常用命令
- npm run dev - 运行创建的项目
- npm run build - 运行打包命令
- npm run unit - 进行单元测试
- npm run e2e - 进行端测试
项目结构
- build - webpack配置文件
- config/index.js - 主要项目配置
- src/
- main.js - 应用入口文件
- App.vue - 主应用程序组件
- components - ui组件
- assets - 模块资源(由webpack处理)
- static - 纯静态资源(直接赋值)
- test
- unit - 单元测试
- e2e - e2e测试
- babelrc - babel 配置
- postcssrc.js - postcss配置
- eslintrc.js - eslint 配置
- editorconfig - editor 配置
- index.html - index.html模板
- package.json - 构建脚本和依赖关系(安装的和应用的命令)
vue常见的前端UI库
- Mint UI
- 项目主页:http://mint-ui.github.io/#!/zh-cn
- demo:http://elemefe.github.io/mint-ui/#/
- GitHub地址:https://github.com/ElemeFE/mint-ui
- 中文文档地址:http://mint-ui.github.io/docs/#!/zh-cn
- VUX(移动端)
- 项目文档:https://vux.li/#/
- github地址:https://github.com/airyland/vux
- 移动端采用vux的单页面应用:https://github.com/rumengkai/vue-spa.git