Skip to content

Commit a5d4bbd

Browse files
authored
[release]4.1.0 (PanJiaChen#211)
1 parent 4bbdf5e commit a5d4bbd

Some content is hidden

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

92 files changed

+1895
-1475
lines changed

.babelrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.env.development

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# just a flag
2+
ENV = 'development'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/dev-api'
6+
7+
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
8+
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
9+
# It only does one thing by converting all import() to require().
10+
# This configuration can significantly increase the speed of hot updates,
11+
# when you have a large number of pages.
12+
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
13+
14+
VUE_CLI_BABEL_TRANSPILE_MODULES = true

.env.production

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# just a flag
2+
ENV = 'production'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/prod-api'
6+

.env.staging

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NODE_ENV = production
2+
3+
# just a flag
4+
ENV = 'staging'
5+
6+
# base api
7+
VUE_APP_BASE_API = '/stage-api'
8+

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build/*.js
2-
config/*.js
32
src/assets
3+
public
4+
dist

.eslintrc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ module.exports = {
2121
"allowFirstLine": false
2222
}
2323
}],
24+
"vue/singleline-html-element-content-newline": "off",
25+
"vue/multiline-html-element-content-newline":"off",
2426
"vue/name-property-casing": ["error", "PascalCase"],
27+
"vue/no-v-html": "off",
2528
'accessor-pairs': 2,
2629
'arrow-spacing': [2, {
2730
'before': true,
@@ -44,7 +47,7 @@ module.exports = {
4447
'curly': [2, 'multi-line'],
4548
'dot-location': [2, 'property'],
4649
'eol-last': 2,
47-
'eqeqeq': [2, 'allow-null'],
50+
'eqeqeq': ["error", "always", {"null": "ignore"}],
4851
'generator-star-spacing': [2, {
4952
'before': true,
5053
'after': true
@@ -73,7 +76,7 @@ module.exports = {
7376
'no-class-assign': 2,
7477
'no-cond-assign': 2,
7578
'no-const-assign': 2,
76-
'no-control-regex': 2,
79+
'no-control-regex': 0,
7780
'no-delete-var': 2,
7881
'no-dupe-args': 2,
7982
'no-dupe-class-members': 2,
@@ -193,4 +196,3 @@ module.exports = {
193196
'array-bracket-spacing': [2, 'never']
194197
}
195198
}
196-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
77
package-lock.json
8+
tests/**/coverage/
89

910
# Editor directories and files
1011
.idea

.postcssrc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// https://github.com/michael-ciniawsky/postcss-load-config
22

33
module.exports = {
4-
"plugins": {
5-
"postcss-import": {},
6-
"postcss-url": {},
4+
'plugins': {
75
// to edit target browsers: use "browserslist" field in package.json
8-
"autoprefixer": {}
6+
'autoprefixer': {}
97
}
108
}

README-zh.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# 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
55
[线上地址](http://panjiachen.github.io/vue-admin-template)
66

77
[国内访问](https://panjiachen.gitee.io/vue-admin-template)
88

9+
目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若发现问题,欢迎提 issue。若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0),它不依赖 `vue-cli`
10+
911
## Extra
1012

1113
如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用该分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
1214

13-
本项目基于`webpack4`开发,若还想使用`webpack3`开发,请使用该分支[webpack3](https://github.com/PanJiaChen/vue-admin-template/tree/webpack3)
14-
15-
如果你想使用基于 vue + typescript 的管理后台, 可以看看这个项目: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour))
16-
1715
## 相关项目
1816

1917
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
@@ -33,53 +31,55 @@
3331
## Build Setup
3432

3533
```bash
36-
# Clone project
34+
# 克隆项目
3735
git clone https://github.com/PanJiaChen/vue-admin-template.git
3836

39-
# Install dependencies
37+
# 进入项目目录
38+
cd vue-admin-template
39+
40+
# 安装依赖
4041
npm install
4142

42-
# 建议不要用cnpm 安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
43+
# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
4344
npm install --registry=https://registry.npm.taobao.org
4445

45-
# Serve with hot reload at localhost:9528
46+
# 启动服务
4647
npm run dev
48+
```
4749

48-
# Build for production with minification
49-
npm run build
50+
浏览器访问 [http://localhost:9528](http://localhost:9528)
5051

51-
# Build for production and view the bundle analyzer report
52-
npm run build --report
53-
```
52+
## 发布
5453

55-
## Demo
54+
```bash
55+
# 构建测试环境
56+
npm run build:stage
5657

57-
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
58+
# 构建生产环境
59+
npm run build:prod
60+
```
5861

59-
### Element-Ui 使用 cdn 教程
62+
## 其它
6063

61-
首先找到 `index.html` ([根目录下](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
64+
```bash
65+
# 预览发布环境效果
66+
npm run preview
6267

63-
引入 Element 的 css 和 js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue 。
68+
# 预览发布环境效果 + 静态资源分析
69+
npm run preview -- --report
6470

65-
之后找到 [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js) 加入 `externals` 让 webpack 不打包 vue 和 element
71+
# 代码格式检查
72+
npm run lint
6673

67-
```
68-
externals: {
69-
vue: 'Vue',
70-
'element-ui':'ELEMENT'
71-
}
74+
# 代码格式检查并自动修复
75+
npm run lint -- --fix
7276
```
7377

74-
之后还有一个小细节是如果你用了全局对象方式引入 vue,就不需要 手动 `Vue.use(Vuex)` ,它会自动挂载,具体见 [issue](https://github.com/vuejs/vuex/issues/731)
78+
更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/)
7579

76-
最终你可以使用 `npm run build --report` 查看效果
77-
如图:
78-
![demo](https://panjiachen.github.io/images/element-cdn.png)
79-
80-
**[具体代码](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
80+
## Demo
8181

82-
**[对应分支](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
82+
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
8383

8484
## Browsers support
8585

README.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,61 @@
11
# vue-admin-template
22

3+
English | [简体中文](./README.zh-CN.md)
4+
35
> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
46
57
**Live demo:** http://panjiachen.github.io/vue-admin-template
68

7-
[中文文档](https://github.com/PanJiaChen/vue-admin-template/blob/master/README-zh.md)
9+
10+
**The current version is `v4.0+` build on `vue-cli`. If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0), it does not rely on `vue-cli'**
811

912
## Build Setup
1013

14+
1115
```bash
12-
# Clone project
13-
git clone https://github.com/PanJiaChen/vue-admin-template.git
16+
# clone the project
17+
git clone https://github.com/PanJiaChen/vue-element-admin.git
18+
19+
# enter the project directory
20+
cd vue-element-admin
1421

15-
# Install dependencies
22+
# install dependency
1623
npm install
1724

18-
# Serve with hot reload at localhost:9528
25+
# develop
1926
npm run dev
27+
```
28+
29+
This will automatically open http://localhost:9527
30+
31+
## Build
32+
33+
```bash
34+
# build for test environment
35+
npm run build:stage
36+
37+
# build for production environment
38+
npm run build:prod
39+
```
40+
41+
## Advanced
42+
43+
```bash
44+
# preview the release environment effect
45+
npm run preview
46+
47+
# preview the release environment effect + static resource analysis
48+
npm run preview -- --report
2049

21-
# Build for production with minification
22-
npm run build
50+
# code format check
51+
npm run lint
2352

24-
# Build for production and view the bundle analyzer report
25-
npm run build --report
53+
# code format check and auto fix
54+
npm run lint -- --fix
2655
```
2756

57+
Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information
58+
2859
## Demo
2960

3061
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
@@ -33,8 +64,6 @@ npm run build --report
3364

3465
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)
3566

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)
37-
3867
For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
3968

4069
## Related Project
@@ -45,34 +74,6 @@ For `typescript` version, you can use [vue-typescript-admin-template](https://gi
4574

4675
[vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
4776

48-
### Element-Ui using cdn tutorial
49-
50-
First find `index.html`([root directory](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/index.html))
51-
52-
Import css and js of `Element`, and then import vue. Because `Element` is vue-dependent, vue must be import before it.
53-
54-
Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vue-admin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
55-
Add `externals` to make webpack not package vue and element.
56-
57-
```
58-
externals: {
59-
vue: 'Vue',
60-
'element-ui':'ELEMENT'
61-
}
62-
```
63-
64-
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
65-
[issue](https://github.com/vuejs/vuex/issues/731)
66-
67-
And you can use `npm run build --report` to see the effect
68-
69-
Pictured:
70-
![demo](https://panjiachen.github.io/images/element-cdn.png)
71-
72-
**[Detailed code](https://github.com/PanJiaChen/vue-admin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
73-
74-
**[Branch](https://github.com/PanJiaChen/vue-admin-template/tree/element-ui-cdn)**
75-
7677
## Browsers support
7778

7879
Modern browsers and Internet Explorer 10+.

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

build/build.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)