|
@@ -37,6 +37,33 @@ If you want router permission && generate menu by user roles , you can use this
|
37
|
37
|
|
38
|
38
|
[electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
39
|
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
|
+
|
40
|
67
|
|
41
|
68
|
## License
|
42
|
69
|
[MIT](https://github.com/PanJiaChen/vueAdmin-template/blob/master/LICENSE) license.
|