├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── .project ├── README.md ├── build ├── build.js ├── check-versions.js ├── logo.png ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js ├── prod.env.js └── test.env.js ├── db.json ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── assets │ ├── css │ │ └── public.css │ └── iconfont │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff ├── components │ ├── HomeMain.vue │ ├── home.vue │ ├── login.vue │ └── table │ │ └── table.vue ├── main.js └── router │ └── index.js ├── static └── .gitkeep └── test ├── e2e ├── custom-assertions │ └── elementCount.js ├── nightwatch.conf.js ├── runner.js └── specs │ └── test.js └── unit ├── .eslintrc ├── jest.conf.js ├── setup.js └── specs └── HelloWorld.spec.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | /test/unit/coverage/ 8 | /test/e2e/reports/ 9 | selenium-debug.log 10 | 11 | # Editor directories and files 12 | .idea 13 | .vscode 14 | *.suo 15 | *.ntvs* 16 | *.njsproj 17 | *.sln 18 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | vue-admin-stepbystep 4 | 5 | 6 | 7 | 8 | 9 | com.aptana.ide.core.unifiedBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.aptana.projects.webnature 16 | 17 | 18 | 19 | 0 20 | 21 | 26 22 | 23 | org.eclipse.ui.ide.multiFilter 24 | 1.0-name-matches-false-false-node_modules 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-admin-stepbystep 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | 20 | ``` 21 | # Vue 项目 22 | 23 | - [项目地址 https://github.com/whylisa/vue-admin-step-by-step) 24 | 25 | ## 项目功能 26 | 27 | - 1 登录 28 | - 2 首页 29 | - 3 退出 30 | - 4 table页 31 | 32 | ## 项目技术点 33 | - 1,使用vue 34 | - 2,使用echarts 35 | - 3, 使用json-server 36 | - 4, 使用node起一个简单的服务,服务于接口 37 | - 5, 使用axios 38 | - 6, vue-router的使用规则(异步加载,和同步加载) 39 | - 7, 回话拦截的使用(localstorage or cookie) 40 | - 8, 配合element-UI 41 | - 9, 修改组件里面的样式里面的坑 42 | - 10, 打包时的优化 43 | - 11, DNS优化 44 | - 12, 配置本地代理,使用接口 45 | - 13, 使用axios配合json-server 模拟增删改查 46 | - 14, 使用nprogress 插件 47 | - 15, 鲜为人知的element-UI 的滚动条 48 | - 16, 栅格布局,大小屏适应配合媒体查询 49 | - 17, css使用less 50 | - 18, 代码风格,个人风格,禁用了jslint 防止不懂得小伙伴抓狂 51 | - 19, 兼容性的处理 52 | 53 | ## 项目搭建 54 | 55 | - 1 `vue init webpack XX` 56 | 57 | ```html 58 | Project name :默认 59 | Project description :默认 60 | Author :默认 61 | Vue build :选择 Runtime + Compiler 62 | Install vue-router? :Y 63 | Use ESLint to lint your code? :Y 选择 Standard 64 | Set up unit tests :n 65 | Setup e2e tests with Nightwatch? : n 66 | Should we run `npm install` for you after the project has been created? (recommended) : Yes, use NPM 67 | ``` 68 | 69 | - 2 进入项目:cd vue-admin-stepbystep 70 | - 3 运行项目:npm run dev 71 | 72 | ## 如何添加一个新的功能??? 73 | 74 | - 1 在 `components` 中新建一个文件夹(login),在文件中创建组件(Login.vue) 75 | - 2 在 `router/index.js` 中导入组件(login.vue) 76 | - 3 配置路由规则 77 | 78 | ## 在项目中使用 element-ui 79 | 80 | - [ElementUI 文档](http://element-cn.eleme.io/#/zh-CN/component/installation) 81 | - 安装:`npm i element-ui -S` 82 | 83 | ```js 84 | // main.js 85 | 86 | // 导入elementui - js 87 | import ElementUI from 'element-ui' 88 | // 导入elementui - css 89 | import 'element-ui/lib/theme-chalk/index.css' 90 | // 安装插件 91 | Vue.use(ElementUI) 92 | ``` 93 | 94 | --- 95 | 96 | ## 项目启动做了什么 97 | 98 | - 1 在终端中运行:`npm run dev`,实际上就是运行了:`webpack-dev-server ...` 99 | - 2 使用 webpack-dev-server 开启一个服务器 100 | - 3 根据指定的入口 `src/main.js` 开始分析入口中使用到的模块 101 | - 4 当遇到 `import` 的时候,webpack 就会加载这些模块内容(如果有重复模块,比如:Vue,实际上将来只会加载一次),遇到代码就执行这些代码 102 | - 5 创建 Vue 实例,将 App 组件作为模板进行编译,并且将 App 组件中 template 的内容渲染在页面 #app 的位置 103 | 104 | ## 登录功能 105 | 106 | - 1 安装:`npm i -S axios` 107 | - 2 在 `Login.vue` 组件中导入 axios 108 | - 3 使用 axios 根据接口文档来发送请求,完成登录 109 | 110 | ## 编程式导航 111 | 112 | - 就是通过 JS 代码来实现路由的跳转功能 113 | 114 | ```js 115 | // 注意:是 router 不是 route 116 | // router用来实现路由跳转,route用来获取路由参数 117 | // push 方法的参数为:要跳转到的路由地址(path) 118 | this.$router.push('/home') 119 | ``` 120 | 121 | ## 密码 122 | 123 | - 给输入框组件添加 type="password" 就变为密码框状态了 124 | 125 | ```html 126 | 127 | ``` 128 | 129 | ## 登录拦截 130 | 131 | - 说明:在没有登录的情况不应该让用户来访问除登录以外的任何页面 132 | 133 | ### 登录和拦截的整个流程说明 134 | 135 | - 1 在登录成功以后,将 token 存储到 localStorage 中 136 | - 2 在 导航守卫 中先判断当前访问的页面是不是登录页面 137 | - 3 如果是登录页面,直接放行(next()) 138 | - 4 如果不是登录页面,就从 localStorage 中获取 token,判断有没有登录 139 | - 5 如果登录了,直接放行(next()) 140 | - 6 如果没有登录,就跳转到登录页面让用户登录(next('/login')) 141 | 142 | ## token 机制的说明 143 | 144 | - 在项目中,如果登录成功了,那么,服务器会给我们返回一个 token 145 | - 这个 token 就是登录成功的标识 146 | - 这个 token 就相当于使用 cookie+session 机制中的 sessionid 147 | 148 | ## 公司人员和项目开发流程 149 | 150 | - 1 产品经理定制项目的需求 151 | - 2 分配任务:先将所有的任务分配到项目组,然后,再由项目组具体分配给每个开发人员 152 | - 3 开发:拿到 产品原型 + 需求文档 + UI 设计稿 资料,转化为 HTML 页面,完成功能 153 | - 4 功能完成后,自己测试有没有 Bug 154 | - 5 由测试人员来测试你的功能,当测试出 Bug 后,就会通过 禅道 这样的项目管理系统,来提出 Bug 155 | - 6 由 自己 修改 测试人员提出来的 bug 156 | - 7 最终,没有 bug 了,项目才会上线 157 | 158 | ```html 159 | 产品经理(Product Manager) 160 | 提需求 161 | 产出: 产品原型 + 需求文档 162 | 原型设计软件:Axure 、墨刀 163 | 164 | UI(设计) 165 | 将 产品经理 给的 原型图 设计为 好看的UI稿 166 | 167 | FE(前端)front-end 168 | 产品原型 + 需求文档 + UI设计稿 ===> HTML页面 169 | 170 | BE(后端) back-end 171 | 给前端提供数据接口 172 | 173 | 测试人员 174 | 产品原型 + 需求文档 + UI设计稿 来测试我们写的功能 175 | 发现你的功能 与 需求 不一致,那就说明除Bug了,那么,测试人员就会提Bug 176 | Bug系统: 禅道 177 | 178 | 项目经理(管理技术) 179 | 技术攻坚,与其他项目组人员沟通,分配任务 等 180 | ``` 181 | 182 | ## vue 单文件组件中的 scoped 183 | 184 | - 作用:给 `style` 标签添加 `scoped` 属性以后,样式只会对当前组件中的结构生效,而不会影响到其他组件 185 | 186 | ## vue 单文件组件中的 lang 187 | 188 | - 作用:添加 `lang="less"` 后,就可以使用 less 语法了 189 | - 但是需要自己安装:`npm i -D less less-loader` 190 | 191 | ## VSCode 中使用 Vetur 插件格式化单文件组件的 template 192 | 193 | - 打开设置,配置:`"vetur.format.defaultFormatter.html": "js-beautify-html"` 194 | 195 | ## 接口调用的说明 196 | 197 | - 注意:**所有接口都需要传递 token,只有传递了正确的 token,服务器才会将数据返回给前端** 198 | - 如果没有传递`token`,服务器会返回 `401` ,告诉接口调用者,没有权限来访问这个接口 199 | 200 | --- 201 | 202 | ## cookie+session VS token 203 | 204 | - [干掉状态:从 session 到 token](https://github.com/zqran/blog/issues/2) 205 | 206 | ## Git 使用 207 | 208 | - [远程分支](https://blog.csdn.net/u012701023/article/details/79222731) 209 | 210 | ```bash 211 | # 克隆仓库 212 | git clone [仓库地址] 213 | 214 | # 推送 215 | git push [仓库地址] master 216 | 217 | # 简化推送地址 218 | git remote add XX [仓库地址] 219 | git push -u XX master 220 | # 第一次执行上面两条命令,以后只需要输入以下命令即可 221 | git push XX 222 | 223 | # 拉取 224 | git pull [仓库地址] master 225 | git pull XX master 226 | ``` 227 | 228 | 229 | 230 | ## 路由参数分页 231 | 232 | - 1 配置分页路由参数, 参数是可选的 233 | - 参数可选后, 路由就能够匹配: `/goods` 或者 `/goods/3` 234 | - 2 使用路由来分页, 有两种情况需要处理: 235 | - 3 第一种: 进入页面,就要根据当前路由参数中的页码,来获取到对应页的数据 236 | - 4 第二种: 点击分页组件获取数据, 需要做两件事: 237 | - 4.1 获取到当前页的数据( 调用获取数据的方法 ) 238 | - 4.2 修改哈希值为当前页码 ( this.$router.push() ) 239 | - 5 点击分页按钮获取数据的第二种思路: 240 | - 5.1 点击分页按钮, 触发了分组件的 pageChange 事件 241 | - 5.2 在 pageChange 事件中修改了路由( this.$router.push() ) 242 | - 5.3 路由发生改变后, watch 中的 $route 监视到了路由的改变 243 | - 5.4 在 `$route(to) {}` 方法中, 通过参数 to 获取到当前页码, 重新调用获取数据的方法来获取当前页的数据 244 | 245 | ## 项目打包和优化 246 | 247 | - 打包命令:`npm run build` 248 | 249 | ## 按需加载 250 | 251 | - 1 修改 `router/index.js` 中导入组件的语法 252 | 253 | ```js 254 | // 使用: 255 | const Home = () => import('@/components/home/Home') 256 | // 替换: 257 | // import Home from '@/components/home/Home' 258 | 259 | // 给打包生产的JS文件起名字 260 | const Home = () => import(/* webpackChunkName: 'home' */ '@/components/home/Home') 261 | 262 | // chunkName相同,将 goods 和 goods-add 两个组件,打包到一起 263 | const Goods = () => import(/* webpackChunkName: 'goods' */'@/components/goods') 264 | const GoodsAdd = () => import(/* webpackChunkName: 'goods' */'@/components/goods-add') 265 | ``` 266 | 267 | - 2 (*该步可省略*)修改 `/build/webpack.prod.conf.js` 中的chunkFilename 268 | 269 | ```js 270 | { 271 | // [name] 代替 [id] 272 | chunkFilename: utils.assetsPath('js/[name].[chunkhash].js') 273 | } 274 | ``` 275 | 276 | ## 使用CDN 277 | 278 | - [开源项目 CDN 加速服务](https://www.bootcdn.cn/) 279 | 280 | - 1 在 `index.html` 中引入CDN提供的JS文件 281 | - 2 在 `/build/webpack.base.conf.js` 中(resolve前面)添加配置 externals 282 | - **注意**:通过CDN引入 element-ui 的样式文件后,就不需要在 main.js 中导入 element-ui 的CSS文件了。所以,直接注释掉 main.js 中的导入 element-ui 样式即可 283 | 284 | - `externals`配置: 285 | 286 | ```js 287 | externals: { 288 | // 键:表示 导入包语法 from 后面跟着的名称 289 | // 值:表示 script 引入JS文件时,在全局环境中的变量名称 290 | vue: 'Vue', 291 | axios: 'axios', 292 | 'vue-router': 'VueRouter', 293 | 'element-ui': 'ELEMENT', 294 | moment: 'moment', 295 | 'vue-quill-editor': 'VueQuillEditor' 296 | 297 | BMap: 'BMap', 298 | echarts: 'echarts', 299 | } 300 | 301 | import ElementUI from 'element-ui' 302 | ``` 303 | 304 | ### 常用包CDN 305 | 306 | - [vue](https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.min.js) 307 | - [vue-router](https://unpkg.com/vue-router@3.0.1/dist/vue-router.min.js) 308 | - [axios](https://unpkg.com/axios/dist/axios.min.js) 309 | - [element-ui JS](https://unpkg.com/element-ui/lib/index.js) 310 | - [element-ui CSS](https://unpkg.com/element-ui/lib/theme-chalk/index.css) 311 | - [moment](https://cdn.bootcss.com/moment.js/2.22.1/moment.min.js) 312 | 313 | - 说明: 314 | - 1 先在官方文档查找提供的CDN 315 | - 2 如果没有,在 `https://www.bootcdn.cn/` 或其他 CDN提供商 查找 316 | 317 | ```html 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | ``` 328 | 329 | ### 移除console 330 | 331 | ```js 332 | new webpack.optimize.UglifyJsPlugin({ 333 | compress:{ 334 | warnings: false, 335 | drop_debugger: true, 336 | drop_console: true 337 | } 338 | }) 339 | ``` 340 | 341 | ## 缓存和保留组件状态 342 | 343 | - [keep-alive](https://www.jianshu.com/p/0b0222954483) 344 | - 解决方式:使用 `keep-alive` ,步骤如下: 345 | 346 | ```html 347 | 1 在需要被缓存组件的路由中添加 meta 属性 348 | meta 属性用来给路由添加一些元信息(其实,就是一些附加信息) 349 | { 350 | path: '/', 351 | name: 'home', 352 | component: Home, 353 | // 需要被缓存 354 | meta: { 355 | keepAlive: true 356 | } 357 | } 358 | 359 | 2 修改路由出口,替换为以下形式: 360 | 根据 meta 是否有 keepAlive 属性,决定该路由是否被缓存 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | ``` 371 | 372 | ## 启用路由的 History 模式 373 | 374 | - 通过在路由中添加 `mode: 'history'` 可以去掉 浏览器地址栏中的 # 375 | - 在开发期间,只需要添加这个配置即可 376 | - 但是,在项目打包以后,就会出现问题 377 | 378 | ```html 379 | // 去掉 # 后,地址变为: 380 | 381 | http://localhost:8080/goods 382 | 383 | 那么,服务器需要正确处理 /goods 才能正确的响应内容, 384 | 但是,/goods 不是服务端的接口,而是 用来在浏览器中实现 VueRouter 路由功能的 385 | ``` 386 | 387 | ### 后端的处理方式 388 | 389 | - 1 优先处理静态资源 390 | - 2 对于非静态资源的请求,全部统一处理返回 index.html 391 | - 3 当浏览器打开 index.html 就会加载 路由的js 文件,那么路由就会解析 URL 中的 /login 这种去掉#的路径了 392 | 393 | 394 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whylisa/vue-admin-step-by-step/0e4c18845ada92095e602b7e0bebde9aaef25170/build/logo.png -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve(dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' ? 22 | config.build.assetsPublicPath : 23 | config.dev.assetsPublicPath 24 | }, 25 | // 开发时要注释 26 | // externals: { 27 | // 'vue': 'Vue', 28 | // 'vue-router': 'VueRouter', 29 | // 'element-ui': 'ELEMENT', 30 | // 'axios': 'axios' 31 | // }, 32 | resolve: { 33 | extensions: ['.js', '.vue', '.json'], 34 | alias: { 35 | 'vue$': 'vue/dist/vue.esm.js', 36 | '@': resolve('src'), 37 | } 38 | }, 39 | module: { 40 | rules: [{ 41 | test: /\.vue$/, 42 | loader: 'vue-loader', 43 | options: vueLoaderConfig 44 | }, 45 | { 46 | test: /\.js$/, 47 | loader: 'babel-loader', 48 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 49 | }, 50 | { 51 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 52 | loader: 'url-loader', 53 | options: { 54 | limit: 10000, 55 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 56 | } 57 | }, 58 | { 59 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 60 | loader: 'url-loader', 61 | options: { 62 | limit: 10000, 63 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 64 | } 65 | }, 66 | { 67 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 68 | loader: 'url-loader', 69 | options: { 70 | limit: 10000, 71 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 72 | } 73 | }, 74 | { 75 | test: /\.less$/, 76 | loader: "style-loader!css-loader!less-loader", 77 | }, 78 | ] 79 | }, 80 | node: { 81 | // prevent webpack from injecting useless setImmediate polyfill because Vue 82 | // source contains it (although only uses it if it's native). 83 | setImmediate: false, 84 | // prevent webpack from injecting mocks to Node native modules 85 | // that does not make sense for the client 86 | dgram: 'empty', 87 | fs: 'empty', 88 | net: 'empty', 89 | tls: 'empty', 90 | child_process: 'empty' 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | // json-server 17 | const jsonServer = require('json-server') 18 | /*搭建一个server*/ 19 | const apiJsonServer = jsonServer.create() 20 | /*将db.json关联到server*/ 21 | const apiRouter = jsonServer.router('db.json') 22 | const jsonWares = jsonServer.defaults() 23 | //全局使用 24 | apiJsonServer.use(jsonWares) 25 | apiJsonServer.use(apiRouter) 26 | /*监听端口*/ 27 | apiJsonServer.listen(8888, () => { 28 | console.log('JSON Server is running') 29 | console.log('localhost:8888') 30 | }) 31 | 32 | const devWebpackConfig = merge(baseWebpackConfig, { 33 | module: { 34 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 35 | }, 36 | // cheap-module-eval-source-map is faster for development 37 | devtool: config.dev.devtool, 38 | 39 | // these devServer options should be customized in /config/index.js 40 | devServer: { 41 | clientLogLevel: 'warning', 42 | historyApiFallback: { 43 | rewrites: [ 44 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 45 | ], 46 | }, 47 | hot: true, 48 | contentBase: false, // since we use CopyWebpackPlugin. 49 | compress: true, 50 | host: HOST || config.dev.host, 51 | port: PORT || config.dev.port, 52 | open: config.dev.autoOpenBrowser, 53 | overlay: config.dev.errorOverlay 54 | ? { warnings: false, errors: true } 55 | : false, 56 | publicPath: config.dev.assetsPublicPath, 57 | proxy: config.dev.proxyTable, 58 | quiet: true, // necessary for FriendlyErrorsPlugin 59 | watchOptions: { 60 | poll: config.dev.poll, 61 | } 62 | }, 63 | plugins: [ 64 | new webpack.DefinePlugin({ 65 | 'process.env': require('../config/dev.env') 66 | }), 67 | new webpack.HotModuleReplacementPlugin(), 68 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 69 | new webpack.NoEmitOnErrorsPlugin(), 70 | // https://github.com/ampedandwired/html-webpack-plugin 71 | new HtmlWebpackPlugin({ 72 | filename: 'index.html', 73 | template: 'index.html', 74 | inject: true 75 | }), 76 | // copy custom static assets 77 | new CopyWebpackPlugin([ 78 | { 79 | from: path.resolve(__dirname, '../static'), 80 | to: config.dev.assetsSubDirectory, 81 | ignore: ['.*'] 82 | } 83 | ]) 84 | ] 85 | }) 86 | 87 | module.exports = new Promise((resolve, reject) => { 88 | portfinder.basePort = process.env.PORT || config.dev.port 89 | portfinder.getPort((err, port) => { 90 | if (err) { 91 | reject(err) 92 | } else { 93 | // publish the new Port, necessary for e2e tests 94 | process.env.PORT = port 95 | // add port to devServer config 96 | devWebpackConfig.devServer.port = port 97 | 98 | // Add FriendlyErrorsPlugin 99 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 100 | compilationSuccessInfo: { 101 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 102 | }, 103 | onErrors: config.dev.notifyOnErrors 104 | ? utils.createNotifierCallback() 105 | : undefined 106 | })) 107 | 108 | resolve(devWebpackConfig) 109 | } 110 | }) 111 | }) 112 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = process.env.NODE_ENV === 'testing' 15 | ? require('../config/test.env') 16 | : require('../config/prod.env') 17 | 18 | const webpackConfig = merge(baseWebpackConfig, { 19 | module: { 20 | rules: utils.styleLoaders({ 21 | sourceMap: config.build.productionSourceMap, 22 | extract: true, 23 | usePostCSS: true 24 | }) 25 | }, 26 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 27 | output: { 28 | path: config.build.assetsRoot, 29 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 30 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 31 | }, 32 | plugins: [ 33 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 34 | new webpack.DefinePlugin({ 35 | 'process.env': env 36 | }), 37 | new UglifyJsPlugin({ 38 | uglifyOptions: { 39 | compress: { 40 | warnings: false 41 | } 42 | }, 43 | sourceMap: config.build.productionSourceMap, 44 | parallel: true 45 | }), 46 | // extract css into its own file 47 | new ExtractTextPlugin({ 48 | filename: utils.assetsPath('css/[name].[contenthash].css'), 49 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 50 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 51 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 52 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 53 | allChunks: true, 54 | }), 55 | // Compress extracted CSS. We are using this plugin so that possible 56 | // duplicated CSS from different components can be deduped. 57 | new OptimizeCSSPlugin({ 58 | cssProcessorOptions: config.build.productionSourceMap 59 | ? { safe: true, map: { inline: false } } 60 | : { safe: true } 61 | }), 62 | // generate dist index.html with correct asset hash for caching. 63 | // you can customize output by editing /index.html 64 | // see https://github.com/ampedandwired/html-webpack-plugin 65 | new HtmlWebpackPlugin({ 66 | filename: process.env.NODE_ENV === 'testing' 67 | ? 'index.html' 68 | : config.build.index, 69 | template: 'index.html', 70 | inject: true, 71 | minify: { 72 | removeComments: true, 73 | collapseWhitespace: true, 74 | removeAttributeQuotes: true 75 | // more options: 76 | // https://github.com/kangax/html-minifier#options-quick-reference 77 | }, 78 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 79 | chunksSortMode: 'dependency' 80 | }), 81 | // keep module.id stable when vendor modules does not change 82 | new webpack.HashedModuleIdsPlugin(), 83 | // enable scope hoisting 84 | new webpack.optimize.ModuleConcatenationPlugin(), 85 | // split vendor js into its own file 86 | new webpack.optimize.CommonsChunkPlugin({ 87 | name: 'vendor', 88 | minChunks (module) { 89 | // any required modules inside node_modules are extracted to vendor 90 | return ( 91 | module.resource && 92 | /\.js$/.test(module.resource) && 93 | module.resource.indexOf( 94 | path.join(__dirname, '../node_modules') 95 | ) === 0 96 | ) 97 | } 98 | }), 99 | // extract webpack runtime and module manifest to its own file in order to 100 | // prevent vendor hash from being updated whenever app bundle is updated 101 | new webpack.optimize.CommonsChunkPlugin({ 102 | name: 'manifest', 103 | minChunks: Infinity 104 | }), 105 | // This instance extracts shared chunks from code splitted chunks and bundles them 106 | // in a separate chunk, similar to the vendor chunk 107 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 108 | new webpack.optimize.CommonsChunkPlugin({ 109 | name: 'app', 110 | async: 'vendor-async', 111 | children: true, 112 | minChunks: 3 113 | }), 114 | 115 | // copy custom static assets 116 | new CopyWebpackPlugin([ 117 | { 118 | from: path.resolve(__dirname, '../static'), 119 | to: config.build.assetsSubDirectory, 120 | ignore: ['.*'] 121 | } 122 | ]) 123 | ] 124 | }) 125 | 126 | if (config.build.productionGzip) { 127 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 128 | 129 | webpackConfig.plugins.push( 130 | new CompressionWebpackPlugin({ 131 | asset: '[path].gz[query]', 132 | algorithm: 'gzip', 133 | test: new RegExp( 134 | '\\.(' + 135 | config.build.productionGzipExtensions.join('|') + 136 | ')$' 137 | ), 138 | threshold: 10240, 139 | minRatio: 0.8 140 | }) 141 | ) 142 | } 143 | 144 | if (config.build.bundleAnalyzerReport) { 145 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 146 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 147 | } 148 | 149 | module.exports = webpackConfig 150 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | '/api': { 15 | changeOrigin:true, 16 | target: 'http://localhost:8888', 17 | pathRewrite: { 18 | '^/api': '' 19 | } 20 | } 21 | }, 22 | 23 | // Various Dev Server settings 24 | host: 'localhost', // can be overwritten by process.env.HOST 25 | port: 1111, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 26 | autoOpenBrowser: true, 27 | errorOverlay: true, 28 | notifyOnErrors: true, 29 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 30 | 31 | 32 | /** 33 | * Source Maps 34 | */ 35 | 36 | // https://webpack.js.org/configuration/devtool/#development 37 | devtool: 'cheap-module-eval-source-map', 38 | 39 | // If you have problems debugging vue-files in devtools, 40 | // set this to false - it *may* help 41 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 42 | cacheBusting: true, 43 | 44 | cssSourceMap: true 45 | }, 46 | 47 | build: { 48 | // Template for index.html 49 | index: path.resolve(__dirname, '../dist/index.html'), 50 | 51 | // Paths 52 | assetsRoot: path.resolve(__dirname, '../dist'), 53 | assetsSubDirectory: 'static', 54 | assetsPublicPath: './', 55 | 56 | /** 57 | * Source Maps 58 | */ 59 | 60 | productionSourceMap: true, 61 | // https://webpack.js.org/configuration/devtool/#production 62 | devtool: '#source-map', 63 | 64 | // Gzip off by default as many popular static hosts such as 65 | // Surge or Netlify already gzip all static assets for you. 66 | // Before setting to `true`, make sure to: 67 | // npm install --save-dev compression-webpack-plugin 68 | productionGzip: false, 69 | productionGzipExtensions: ['js', 'css'], 70 | 71 | // Run the build command with an extra argument to 72 | // View the bundle analyzer report after build finishes: 73 | // `npm run build --report` 74 | // Set to `true` or `false` to always turn it on or off 75 | bundleAnalyzerReport: process.env.npm_config_report 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const devEnv = require('./dev.env') 4 | 5 | module.exports = merge(devEnv, { 6 | NODE_ENV: '"testing"' 7 | }) 8 | -------------------------------------------------------------------------------- /db.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": [ 3 | { 4 | "username": "why", 5 | "password": 123456 6 | } 7 | ], 8 | "table": [ 9 | { 10 | "id": 1, 11 | "date": "why", 12 | "name": 123456, 13 | "address": "上海市虹口区" 14 | }, 15 | { 16 | "id": 2, 17 | "date": "why", 18 | "name": 123456, 19 | "address": "上海市虹口区" 20 | }, 21 | { 22 | "id": 3, 23 | "date": "why", 24 | "name": 123456, 25 | "address": "上海市虹口区" 26 | }, 27 | { 28 | "id": 4, 29 | "date": "why", 30 | "name": 123456, 31 | "address": "上海市虹口区" 32 | }, 33 | { 34 | "id": 5, 35 | "date": "2018-12-16", 36 | "name": "why", 37 | "address": "虹桥机场" 38 | }, 39 | { 40 | "date": 2019, 41 | "name": "hh", 42 | "address": "shanghai", 43 | "id": 6 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | webclient 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webclient", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "haoyue.wang <843655240@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "unit": "jest --config test/unit/jest.conf.js --coverage", 11 | "e2e": "node test/e2e/runner.js", 12 | "test": "npm run unit && npm run e2e", 13 | "build": "node build/build.js" 14 | }, 15 | "dependencies": { 16 | "axios": "^0.18.0", 17 | "echarts": "^4.2.0-rc.2", 18 | "element-ui": "^2.4.9", 19 | "json-server": "^0.14.0", 20 | "less": "^3.8.1", 21 | "less-loader": "^4.1.0", 22 | "nprogress": "^0.2.0", 23 | "vue": "^2.5.2", 24 | "vue-router": "^3.0.1" 25 | }, 26 | "devDependencies": { 27 | "autoprefixer": "^7.1.2", 28 | "babel-core": "^6.22.1", 29 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 30 | "babel-jest": "^21.0.2", 31 | "babel-loader": "^7.1.1", 32 | "babel-plugin-dynamic-import-node": "^1.2.0", 33 | "babel-plugin-syntax-jsx": "^6.18.0", 34 | "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", 35 | "babel-plugin-transform-runtime": "^6.22.0", 36 | "babel-plugin-transform-vue-jsx": "^3.5.0", 37 | "babel-preset-env": "^1.3.2", 38 | "babel-preset-stage-2": "^6.22.0", 39 | "babel-register": "^6.22.0", 40 | "chalk": "^2.0.1", 41 | "chromedriver": "^2.27.2", 42 | "copy-webpack-plugin": "^4.0.1", 43 | "cross-spawn": "^5.0.1", 44 | "css-loader": "^0.28.0", 45 | "extract-text-webpack-plugin": "^3.0.0", 46 | "file-loader": "^1.1.4", 47 | "friendly-errors-webpack-plugin": "^1.6.1", 48 | "html-webpack-plugin": "^2.30.1", 49 | "jest": "^22.0.4", 50 | "jest-serializer-vue": "^0.3.0", 51 | "nightwatch": "^0.9.12", 52 | "node-notifier": "^5.1.2", 53 | "optimize-css-assets-webpack-plugin": "^3.2.0", 54 | "ora": "^1.2.0", 55 | "portfinder": "^1.0.13", 56 | "postcss-import": "^11.0.0", 57 | "postcss-loader": "^2.0.8", 58 | "postcss-url": "^7.2.1", 59 | "rimraf": "^2.6.0", 60 | "selenium-server": "^3.0.1", 61 | "semver": "^5.3.0", 62 | "shelljs": "^0.7.6", 63 | "uglifyjs-webpack-plugin": "^1.1.1", 64 | "url-loader": "^0.5.8", 65 | "vue-jest": "^1.0.2", 66 | "vue-loader": "^13.3.0", 67 | "vue-style-loader": "^3.0.1", 68 | "vue-template-compiler": "^2.5.2", 69 | "webpack": "^3.6.0", 70 | "webpack-bundle-analyzer": "^2.9.0", 71 | "webpack-dev-server": "^2.9.1", 72 | "webpack-merge": "^4.1.0" 73 | }, 74 | "engines": { 75 | "node": ">= 6.0.0", 76 | "npm": ">= 3.0.0" 77 | }, 78 | "browserslist": [ 79 | "> 1%", 80 | "last 2 versions", 81 | "not ie <= 8" 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 30 | -------------------------------------------------------------------------------- /src/assets/css/public.css: -------------------------------------------------------------------------------- 1 | .count { 2 | border-left: 3px solid #5ABFDB; 3 | text-indent: 14px; 4 | font-size: 18px; 5 | color: rgba(26, 26, 26, 1) 6 | } 7 | .bg-purple { 8 | background: #FFFFFF; 9 | } 10 | /* 去除input 蓝色边框/ */ 11 | input,button ,select,textarea{ 12 | outline: none; 13 | text-shadow: none; 14 | border: none; 15 | border-radius: 4px; 16 | } 17 | textarea{ 18 | resize:none; 19 | } 20 | button,select{ 21 | cursor: pointer; 22 | } 23 | input{ 24 | /* text-indent: 1em; */ 25 | } 26 | ::-webkit-input-placeholder{ 27 | color: #999; 28 | text-indent: 1em; 29 | } /* 使用webkit内核的浏览器 */ 30 | :-moz-placeholder{ 31 | color: #999; 32 | text-indent: 1em; 33 | } /* Firefox版本4-18 */ 34 | ::-moz-placeholder{ 35 | color: #999; 36 | text-indent: 1em; 37 | } /* Firefox版本19+ */ 38 | :-ms-input-placeholder{ 39 | color: #999; 40 | text-indent: 1em; 41 | } /* IE浏览器 */ 42 | /*清除浮动*/ 43 | .clearfix::before, 44 | .clearfix::after { 45 | content: ""; 46 | clear: both; 47 | display: block; 48 | height: 0; 49 | visibility: hidden; 50 | line-height: 0; 51 | } 52 | .clearfix { 53 | *zoom: 1; 54 | } 55 | img{ 56 | vertical-align: middle; 57 | } 58 | 59 | /* 分页 */ 60 | .el-pagination { 61 | text-align: center; 62 | } 63 | .mt-10 { 64 | margin-top: 10px; 65 | } 66 | .mt-20 { 67 | margin-top: 20px; 68 | } 69 | p,span,strong,i,div{ 70 | font-size: 14px; 71 | } -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1542275500612'); /* IE9*/ 4 | src: url('iconfont.eot?t=1542275500612#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAB50AAsAAAAALOAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8d0tBY21hcAAAAYAAAAFWAAAD2j6YpdhnbHlmAAAC2AAAGEQAACJEp13dHmhlYWQAABscAAAAMQAAADYT/wlWaGhlYQAAG1AAAAAgAAAAJAiYBFxobXR4AAAbcAAAACEAAACEhMf/8mxvY2EAABuUAAAARAAAAESASof4bWF4cAAAG9gAAAAfAAAAIAE8AdxuYW1lAAAb+AAAAUUAAAJtPlT+fXBvc3QAAB1AAAABNAAAAbFj0C9ceJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWOcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbx0Z27438AQw9zE0AgUZgTJAQDktww2eJzd08FKQkEYxfH/9ZZpXa2s7JZZYuAigiBaVIuICITeQPfte4kW7XqWXsC3ORL0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OaSuE0GdYUj5yuOC5FNcllG0iWI3W6UrRU0m24cRR7TfJFpBPeUuk+baqHxzBbbSqZ/Mpu12mv0RbeyFn+Fjg9XBs/YVtxt3m+pk5BhQr/InneL61UfmI=') format('woff'), 6 | url('iconfont.ttf?t=1542275500612') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('iconfont.svg?t=1542275500612#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-dianhuazixun:before { content: "\e601"; } 19 | 20 | .icon-weibiaoti1:before { content: "\e60c"; } 21 | 22 | .icon-sum:before { content: "\e947"; } 23 | 24 | .icon-tubiao312:before { content: "\e623"; } 25 | 26 | .icon-weixinzhifu:before { content: "\e62a"; } 27 | 28 | .icon-yingxiaoguanhuai:before { content: "\e616"; } 29 | 30 | .icon-084tuichu:before { content: "\e659"; } 31 | 32 | .icon-shouye:before { content: "\e639"; } 33 | 34 | .icon-gantanhao:before { content: "\e685"; } 35 | 36 | .icon-big-Pay:before { content: "\e6ec"; } 37 | 38 | .icon-caiwu:before { content: "\e618"; } 39 | 40 | .icon-chanpin1:before { content: "\e61d"; } 41 | 42 | .icon-lianxiwomen:before { content: "\e609"; } 43 | 44 | .icon-message-channel:before { content: "\e689"; } 45 | 46 | .icon-kefu:before { content: "\e734"; } 47 | 48 | .icon-yonghuming:before { content: "\e65a"; } 49 | 50 | .icon-riqi:before { content: "\e670"; } 51 | 52 | .icon-yuyin:before { content: "\e600"; } 53 | 54 | .icon-yanzhengma1:before { content: "\e61b"; } 55 | 56 | .icon-xitongguanli-:before { content: "\e608"; } 57 | 58 | .icon-yewu-tianchong:before { content: "\e622"; } 59 | 60 | .icon-chuanzhen:before { content: "\e602"; } 61 | 62 | .icon-kaifazhequanxianpeizhi:before { content: "\e60d"; } 63 | 64 | .icon-ecurityCode:before { content: "\e60e"; } 65 | 66 | .icon-lianxirenwode:before { content: "\e612"; } 67 | 68 | .icon-world:before { content: "\e620"; } 69 | 70 | .icon-tongzhi:before { content: "\e765"; } 71 | 72 | .icon-youjianduanxin:before { content: "\e626"; } 73 | 74 | .icon-cuowu:before { content: "\e603"; } 75 | 76 | .icon-xiaoxi:before { content: "\e62f"; } 77 | 78 | .icon-mima:before { content: "\e6b2"; } 79 | 80 | .icon-yanzhengma:before { content: "\e6bf"; } 81 | 82 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whylisa/vue-admin-step-by-step/0e4c18845ada92095e602b7e0bebde9aaef25170/src/assets/iconfont/iconfont.eot -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by iconfont 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whylisa/vue-admin-step-by-step/0e4c18845ada92095e602b7e0bebde9aaef25170/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whylisa/vue-admin-step-by-step/0e4c18845ada92095e602b7e0bebde9aaef25170/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /src/components/HomeMain.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 286 | 287 | 436 | -------------------------------------------------------------------------------- /src/components/home.vue: -------------------------------------------------------------------------------- 1 | 87 | 88 | 115 | 116 | 231 | -------------------------------------------------------------------------------- /src/components/login.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 97 | 98 | 154 | -------------------------------------------------------------------------------- /src/components/table/table.vue: -------------------------------------------------------------------------------- 1 | 50 | 51 | 127 | 128 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | //引入 element-ui 7 | import ElementUI from 'element-ui' 8 | //el样式 9 | import 'element-ui/lib/theme-chalk/index.css' 10 | //引入字体图标 11 | import "./assets/iconfont/iconfont.css" 12 | //公共样式 13 | import "./assets/css/public.css" 14 | // 引入echarts 15 | import echarts from 'echarts' 16 | // 导入axios 17 | import axios from 'axios' 18 | // 把echarts对象绑定到Vue原型中全局使用 19 | Vue.prototype.$echarts = echarts 20 | // 把axios对象绑定到Vue原型中全局使用 21 | Vue.prototype.axios = axios 22 | // 把ElementUI对象绑定到Vue原型中全局使用 23 | Vue.use(ElementUI) 24 | 25 | Vue.config.productionTip = false 26 | 27 | /* eslint-disable no-new */ 28 | new Vue({ 29 | el: '#app', 30 | router, 31 | components: { App }, 32 | template: '' 33 | }) 34 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | //引入nprogress进度条 4 | import NProgress from 'nprogress' 5 | //引入nprogress进度条的样式 6 | import 'nprogress/nprogress.css' 7 | //在打包过程中每一个组件都会打包成一个js文件,如果不使用使用/* webpackChunkName: "home" */ 8 | //在打包的时候就会生成0.js,1.js等等,使用了之后就会打包成home.js 9 | // 导入 Login 组件(注意,不要添加 .vue 后缀) 10 | //这是路由的异步加载,!important,这是优化项目必须的 11 | 12 | //引入home组件/* webpackChunkName: "login" */ 13 | const Home = () => import(/* webpackChunkName: "home" */ '@/components/home') 14 | //引入登录组件 15 | const Login = () => import(/* webpackChunkName: "login" */ '@/components/login') 16 | //引入table组件 17 | const Table = () => import(/* webpackChunkName: "table" */ '@/components/table/table') 18 | //引入homeMain组件 19 | const HomeMain = () => import(/* webpackChunkName: "HomeMain" */ '@/components/HomeMain') 20 | 21 | //这里是同步加载 22 | //import Login from '@/components/login/Login' 23 | 24 | Vue.use(Router) 25 | 26 | const router = new Router({ 27 | mode: 'history',//开启了history模式,去除了#, 28 | // 在vue中,一般来说通过实例去访问某个属性的 29 | // vm.xxxx vm.$set vm.$refs vm.$router 30 | routes: [ 31 | { 32 | path: '/', 33 | redirect: '/homeMain'//路由的重定向 34 | }, 35 | { 36 | path: '/login', 37 | name: 'login', 38 | component: Login 39 | }, 40 | { 41 | path: '/home', 42 | name: 'home', 43 | component: Home, 44 | // children 用来配置子路由,将来匹配的组件会展示在 Home 组件的 router-view 中 45 | // 对于子路由path来说: 46 | // 1 如果不是以 / 开头,那么,哈希值为: 父级path + / + 子级path 47 | // 也就是: /home/homeMain 48 | // 2 如果子级路由的path是以 / 开头的,那么将来的哈希值为:/users 不再带有父级的path了 49 | // 也就是:/homeMain 50 | //这是页面中的子路由,在页面中必须声明router-view作为出口 51 | children: [ 52 | { 53 | path: '/homeMain', 54 | name: 'homeMain', 55 | component: HomeMain 56 | }, 57 | { 58 | path: '/table', 59 | name: 'table', 60 | component:Table 61 | } 62 | ] 63 | } 64 | ] 65 | }); 66 | // 给router配置导航守卫 67 | // to: 去哪儿 68 | // from: from 哪儿来 69 | // next() : next():放行 next('/login') 去login组件 70 | // 在登录成功以后,将 token 存储到 localStorage 中 71 | // 在 导航守卫 中先判断当前访问的页面是不是登录页面 72 | // 如果是登录页面,直接放行(next()) 73 | // 如果不是登录页面,就从 localStorage 中获取 token,判断有没有登录 74 | // 如果登录了,直接放行(next()) 75 | // 如果没有登录,就跳转到登录页面让用户登录(next('/login') 76 | router.beforeEach((to, from, next) => { 77 | // 开启进度条 78 | NProgress.start() 79 | // 获取是否有token 80 | let token = localStorage.getItem('myToken') 81 | // 如果已经就是要去login了,就不需要拦截了 82 | if (to.path === '/login' || token) { 83 | next() 84 | }else { 85 | next('/login') 86 | } 87 | 88 | }); 89 | router.afterEach(() => { 90 | // 关闭进度条 91 | NProgress.done() 92 | }) 93 | 94 | export default router -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whylisa/vue-admin-step-by-step/0e4c18845ada92095e602b7e0bebde9aaef25170/static/.gitkeep -------------------------------------------------------------------------------- /test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // The assertion name is the filename. 3 | // Example usage: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // For more information on custom assertions see: 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | 10 | exports.assertion = function (selector, count) { 11 | this.message = 'Testing if element <' + selector + '> has count: ' + count 12 | this.expected = count 13 | this.pass = function (val) { 14 | return val === this.expected 15 | } 16 | this.value = function (res) { 17 | return res.value 18 | } 19 | this.command = function (cb) { 20 | var self = this 21 | return this.api.execute(function (selector) { 22 | return document.querySelectorAll(selector).length 23 | }, [selector], function (res) { 24 | cb.call(self, res) 25 | }) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/gettingstarted#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: require('selenium-server').path, 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | 4 | const webpack = require('webpack') 5 | const DevServer = require('webpack-dev-server') 6 | 7 | const webpackConfig = require('../../build/webpack.prod.conf') 8 | const devConfigPromise = require('../../build/webpack.dev.conf') 9 | 10 | let server 11 | 12 | devConfigPromise.then(devConfig => { 13 | const devServerOptions = devConfig.devServer 14 | const compiler = webpack(webpackConfig) 15 | server = new DevServer(compiler, devServerOptions) 16 | const port = devServerOptions.port 17 | const host = devServerOptions.host 18 | return server.listen(port, host) 19 | }) 20 | .then(() => { 21 | // 2. run the nightwatch test suite against it 22 | // to run in additional browsers: 23 | // 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings" 24 | // 2. add it to the --env flag below 25 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 26 | // For more information on Nightwatch's config file, see 27 | // http://nightwatchjs.org/guide#settings-file 28 | let opts = process.argv.slice(2) 29 | if (opts.indexOf('--config') === -1) { 30 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 31 | } 32 | if (opts.indexOf('--env') === -1) { 33 | opts = opts.concat(['--env', 'chrome']) 34 | } 35 | 36 | const spawn = require('cross-spawn') 37 | const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 38 | 39 | runner.on('exit', function (code) { 40 | server.close() 41 | process.exit(code) 42 | }) 43 | 44 | runner.on('error', function (err) { 45 | server.close() 46 | throw err 47 | }) 48 | }) 49 | -------------------------------------------------------------------------------- /test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | }, 5 | "globals": { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/unit/jest.conf.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = { 4 | rootDir: path.resolve(__dirname, '../../'), 5 | moduleFileExtensions: [ 6 | 'js', 7 | 'json', 8 | 'vue' 9 | ], 10 | moduleNameMapper: { 11 | '^@/(.*)$': '/src/$1' 12 | }, 13 | transform: { 14 | '^.+\\.js$': '/node_modules/babel-jest', 15 | '.*\\.(vue)$': '/node_modules/vue-jest' 16 | }, 17 | testPathIgnorePatterns: [ 18 | '/test/e2e' 19 | ], 20 | snapshotSerializers: ['/node_modules/jest-serializer-vue'], 21 | setupFiles: ['/test/unit/setup'], 22 | mapCoverage: true, 23 | coverageDirectory: '/test/unit/coverage', 24 | collectCoverageFrom: [ 25 | 'src/**/*.{js,vue}', 26 | '!src/main.js', 27 | '!src/router/index.js', 28 | '!**/node_modules/**' 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /test/unit/setup.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | -------------------------------------------------------------------------------- /test/unit/specs/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import HelloWorld from '@/components/HelloWorld' 3 | 4 | describe('HelloWorld.vue', () => { 5 | it('should render correct contents', () => { 6 | const Constructor = Vue.extend(HelloWorld) 7 | const vm = new Constructor().$mount() 8 | expect(vm.$el.querySelector('.hello h1').textContent) 9 | .toEqual('Welcome to Your Vue.js App') 10 | }) 11 | }) 12 | --------------------------------------------------------------------------------