|
@ -0,0 +1,71 @@
|
|
1
|
# vueAdmin-template
|
|
2
|
|
|
3
|
> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint
|
|
4
|
|
|
5
|
**Live demo:** http://panjiachen.github.io/vueAdmin-template
|
|
6
|
|
|
7
|
[中文文档](https://github.com/PanJiaChen/vueAdmin-template/blob/master/README-zh.md)
|
|
8
|
|
|
9
|
## Build Setup
|
|
10
|
|
|
11
|
``` bash
|
|
12
|
|
|
13
|
# Clone project
|
|
14
|
git clone https://github.com/PanJiaChen/vueAdmin-template.git
|
|
15
|
|
|
16
|
# Install dependencies
|
|
17
|
npm install
|
|
18
|
|
|
19
|
# serve with hot reload at localhost:9528
|
|
20
|
npm run dev
|
|
21
|
|
|
22
|
# build for production with minification
|
|
23
|
npm run build
|
|
24
|
|
|
25
|
# build for production and view the bundle analyzer report
|
|
26
|
npm run build --report
|
|
27
|
```
|
|
28
|
|
|
29
|
## Demo
|
|
30
|

|
|
31
|
|
|
32
|
## 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)
|
|
34
|
|
|
35
|
## Related Project
|
|
36
|
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
|
|
37
|
|
|
38
|
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
|
39
|
|
|
40
|
### Element-Ui using cdn tutorial
|
|
41
|
First find `index.html`([root directory](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/index.html))
|
|
42
|
|
|
43
|
Import css and js of `Element`, and then import vue. Because `Element` is vue-dependent, vue must be import before it.
|
|
44
|
|
|
45
|
Then find [webpack.base.conf.js](https://github.com/PanJiaChen/vueAdmin-template/blob/element-ui-cdn/build/webpack.base.conf.js)
|
|
46
|
Add `externals` to make webpack not package vue and element.
|
|
47
|
|
|
48
|
```
|
|
49
|
externals: {
|
|
50
|
vue: 'Vue',
|
|
51
|
'element-ui':'ELEMENT'
|
|
52
|
}
|
|
53
|
```
|
|
54
|
|
|
55
|
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)
|
|
57
|
|
|
58
|
And you can use `npm run build --report` to see the effect
|
|
59
|
|
|
60
|
Pictured:
|
|
61
|

|
|
62
|
|
|
63
|
**[Detailed code](https://github.com/PanJiaChen/vueAdmin-template/commit/746aff560932704ae821f82f10b8b2a9681d5177)**
|
|
64
|
|
|
65
|
**[Branch](https://github.com/PanJiaChen/vueAdmin-template/tree/element-ui-cdn)**
|
|
66
|
|
|
67
|
|
|
68
|
## License
|
|
69
|
[MIT](https://github.com/PanJiaChen/vueAdmin-template/blob/master/LICENSE) license.
|
|
70
|
|
|
71
|
Copyright (c) 2017-present PanJiaChen
|