Skip to content

Commit bc2f375

Browse files
committed
Merge branch 'master' into unit-test
2 parents ff1e8fa + 61394e5 commit bc2f375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+597
-428
lines changed

.eslintrc.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
root: true,
3-
parser: 'babel-eslint',
43
parserOptions: {
4+
parser: 'babel-eslint',
55
sourceType: 'module'
66
},
77
env: {
@@ -10,22 +10,19 @@ module.exports = {
1010
es6: true,
1111
jest: true
1212
},
13-
extends: 'eslint:recommended',
14-
// required to lint *.vue files
15-
plugins: [
16-
'html'
17-
],
18-
// check if imports actually resolve
19-
'settings': {
20-
'import/resolver': {
21-
'webpack': {
22-
'config': 'build/webpack.base.conf.js'
23-
}
24-
}
25-
},
13+
extends: ['plugin:vue/recommended', 'eslint:recommended'],
14+
2615
// add your custom rules here
2716
//it is base on https://github.com/vuejs/eslint-config-vue
2817
rules: {
18+
"vue/max-attributes-per-line": [2, {
19+
"singleline": 10,
20+
"multiline": {
21+
"max": 1,
22+
"allowFirstLine": false
23+
}
24+
}],
25+
"vue/name-property-casing": ["error", "PascalCase"],
2926
'accessor-pairs': 2,
3027
'arrow-spacing': [2, {
3128
'before': true,
@@ -197,3 +194,4 @@ module.exports = {
197194
'array-bracket-spacing': [2, 'never']
198195
}
199196
}
197+

README-zh.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,84 @@
1-
# vueAdmin-template
1+
# vue-admin-template
22

3-
> 这是一个 极简的vue admin 管理后台 它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
3+
> 这是一个 极简的 vue admin 管理后台 它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
44
5-
[线上地址](http://panjiachen.github.io/vueAdmin-template)
5+
[线上地址](http://panjiachen.github.io/vue-admin-template)
6+
7+
[国内访问](https://panjiachen.gitee.io/vue-admin-template)
68

79
## Extra
8-
如果你想要根据用户角色来动态生成侧边栏和router,你可以使用改分支[permission-control](https://github.com/PanJiaChen/vueAdmin-template/tree/permission-control)
9-
 
10-
## 相关项目
11-
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
1210

13-
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
11+
如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用改分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
12+
13+
本项目基于`webpack4`开发,若还想使用`webpack3`开发,请使用该分支[webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
14+
15+
## 相关项目
16+
17+
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
18+
19+
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
1420

1521
写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
16-
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
17-
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
18-
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
19-
- [手摸手,带你用vue撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
20-
- [手摸手,带你封装一个vue component](https://segmentfault.com/a/1190000009090836)
2122

23+
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
24+
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
25+
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
26+
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
27+
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
2228

2329
## Build Setup
2430

25-
``` bash
26-
31+
```bash
2732
# Clone project
28-
git clone https://github.com/PanJiaChen/vueAdmin-template.git
33+
git clone https://github.com/PanJiaChen/vue-admin-template.git
2934

3035
# Install dependencies
3136
npm install
3237

3338
# 建议不要用cnpm 安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
3439
npm install --registry=https://registry.npm.taobao.org
3540

36-
# serve with hot reload at localhost:9528
41+
# Serve with hot reload at localhost:9528
3742
npm run dev
3843

39-
# build for production with minification
44+
# Build for production with minification
4045
npm run build
4146

42-
# build for production and view the bundle analyzer report
47+
# Build for production and view the bundle analyzer report
4348
npm run build --report
4449
```
4550

4651
## Demo
52+
4753
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
4854

49-
### Element-Ui 使用cdn教程
50-
首先找到 `index.html` ([根目录下](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/index.html))
55+
### Element-Ui 使用 cdn 教程
56+
57+
首先找到 `index.html` ([根目录下](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
58+
59+
引入 Element 的 css 和 js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue 。
5160

52-
引入 Element的css和js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue
61+
之后找到 [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js) 加入 `externals` 让 webpack 不打包 vue 和 element
5362

54-
之后找到 [webpack.base.conf.js](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/build/webpack.base.conf.js) 加入 `externals` 让webpack 不打包 vue 和 element
5563
```
5664
externals: {
5765
vue: 'Vue',
5866
'element-ui':'ELEMENT'
5967
}
6068
```
6169

62-
之后还有一个小细节是如果你用了全局对象方式引入vue,就不需要 手动 `Vue.use(Vuex)` ,它会自动挂载,具体见 [issue](https://github.com/vuejs/vuex/issues/731)
70+
之后还有一个小细节是如果你用了全局对象方式引入 vue,就不需要 手动 `Vue.use(Vuex)` ,它会自动挂载,具体见 [issue](https://github.com/vuejs/vuex/issues/731)
6371

6472
最终你可以使用 `npm run build --report` 查看效果
6573
如图:
6674
![demo](https://panjiachen.github.io/images/element-cdn.png)
6775

68-
**[具体代码](https://github.com/PanJiaChen/vueAdmin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
76+
**[具体代码](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
6977

70-
**[对应分支](https://github.com/PanJiaChen/vueAdmin-template/tree/element-ui-cdn)**
78+
**[对应分支](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
7179

7280
## License
73-
[MIT](https://github.com/PanJiaChen/vueAdmin-template/blob/master/LICENSE) license.
74-
75-
Copyright (c) 2017-present PanJiaChen
7681

82+
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
7783

84+
Copyright (c) 2017-present PanJiaChen

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
1-
# vueAdmin-template
1+
# vue-admin-template
22

33
> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
44
5-
**Live demo:** http://panjiachen.github.io/vueAdmin-template
5+
**Live demo:** http://panjiachen.github.io/vue-admin-template
66

7-
[中文文档](https://github.com/PanJiaChen/vueAdmin-template/blob/master/README-zh.md)
7+
[中文文档](https://github.com/PanJiaChen/vue-admin-template/blob/master/README-zh.md)
88

99
## Build Setup
1010

11-
``` bash
12-
11+
```bash
1312
# Clone project
14-
git clone https://github.com/PanJiaChen/vueAdmin-template.git
13+
git clone https://github.com/PanJiaChen/vue-admin-template.git
1514

1615
# Install dependencies
1716
npm install
1817

19-
# serve with hot reload at localhost:9528
18+
# Serve with hot reload at localhost:9528
2019
npm run dev
2120

22-
# build for production with minification
21+
# Build for production with minification
2322
npm run build
2423

25-
# build for production and view the bundle analyzer report
24+
# Build for production and view the bundle analyzer report
2625
npm run build --report
2726
```
2827

2928
## Demo
29+
3030
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
3131

3232
## Extra
33-
If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vueAdmin-template/tree/permission-control)
33+
34+
If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
35+
36+
This project is based on `webpack4` development. If you want to use `webpack3` development, please use this branch [webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
3437

3538
## Related Project
36-
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
3739

38-
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
40+
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
41+
42+
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
3943

4044
### Element-Ui using cdn tutorial
41-
First find `index.html`([root directory](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/index.html))
45+
46+
First find `index.html`([root directory](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
4247

4348
Import css and js of `Element`, and then import vue. Because `Element` is vue-dependent, vue must be import before it.
4449

45-
Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
50+
Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
4651
Add `externals` to make webpack not package vue and element.
4752

4853
```
@@ -53,19 +58,19 @@ externals: {
5358
```
5459

5560
Finally there is a small detail to pay attention to that if you import vue in global, you don't need to manually `Vue.use(Vuex)`, it will be automatically mounted, see
56-
[issue](https://github.com/vuejs/vuex/issues/731)
61+
[issue](https://github.com/vuejs/vuex/issues/731)
5762

5863
And you can use `npm run build --report` to see the effect
5964

6065
Pictured:
6166
![demo](https://panjiachen.github.io/images/element-cdn.png)
6267

63-
**[Detailed code](https://github.com/PanJiaChen/vueAdmin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
64-
65-
**[Branch](https://github.com/PanJiaChen/vueAdmin-template/tree/element-ui-cdn)**
68+
**[Detailed code](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
6669

70+
**[Branch](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
6771

6872
## License
69-
[MIT](https://github.com/PanJiaChen/vueAdmin-template/blob/master/LICENSE) license.
73+
74+
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
7075

7176
Copyright (c) 2017-present PanJiaChen

build/build.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,27 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
1919
webpack(webpackConfig, (err, stats) => {
2020
spinner.stop()
2121
if (err) throw err
22-
process.stdout.write(stats.toString({
23-
colors: true,
24-
modules: false,
25-
children: false,
26-
chunks: false,
27-
chunkModules: false
28-
}) + '\n\n')
22+
process.stdout.write(
23+
stats.toString({
24+
colors: true,
25+
modules: false,
26+
children: false,
27+
chunks: false,
28+
chunkModules: false
29+
}) + '\n\n'
30+
)
2931

3032
if (stats.hasErrors()) {
3133
console.log(chalk.red(' Build failed with errors.\n'))
3234
process.exit(1)
3335
}
3436

3537
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-
))
38+
console.log(
39+
chalk.yellow(
40+
' Tip: built files are meant to be served over an HTTP server.\n' +
41+
" Opening index.html over file:// won't work.\n"
42+
)
43+
)
4044
})
4145
})

build/check-versions.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ const semver = require('semver')
44
const packageConfig = require('../package.json')
55
const shell = require('shelljs')
66

7-
function exec (cmd) {
8-
return require('child_process').execSync(cmd).toString().trim()
7+
function exec(cmd) {
8+
return require('child_process')
9+
.execSync(cmd)
10+
.toString()
11+
.trim()
912
}
1013

1114
const versionRequirements = [
@@ -24,23 +27,30 @@ if (shell.which('npm')) {
2427
})
2528
}
2629

27-
module.exports = function () {
30+
module.exports = function() {
2831
const warnings = []
2932

3033
for (let i = 0; i < versionRequirements.length; i++) {
3134
const mod = versionRequirements[i]
3235

3336
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+
warnings.push(
38+
mod.name +
39+
': ' +
40+
chalk.red(mod.currentVersion) +
41+
' should be ' +
42+
chalk.green(mod.versionRequirement)
3743
)
3844
}
3945
}
4046

4147
if (warnings.length) {
4248
console.log('')
43-
console.log(chalk.yellow('To use this template, you must update following to modules:'))
49+
console.log(
50+
chalk.yellow(
51+
'To use this template, you must update following to modules:'
52+
)
53+
)
4454
console.log()
4555

4656
for (let i = 0; i < warnings.length; i++) {

0 commit comments

Comments
 (0)