├── .babelrc ├── .gitignore ├── .happypack ├── cache--1.json ├── cache--css.json ├── cache--js.json ├── s--1127144070 ├── s--1127144070.map ├── s--1234760282 ├── s--1234760282.map ├── s--1431284809 ├── s--1431284809.map ├── s--1975755683 ├── s--1975755683.map ├── s--1998424397 ├── s--1998424397.map ├── s--333643577 ├── s--333643577.map ├── s--496596180 ├── s--496596180.map ├── s--777031159 ├── s--777031159.map ├── s--875313428 ├── s--875313428.map ├── s-130684882 ├── s-130684882.map ├── s-1662909811 ├── s-1662909811.map ├── s-1669978561 ├── s-1669978561.map ├── s-1904225868 ├── s-1904225868.map ├── s-1933827370 ├── s-1933827370.map ├── s-727255632 └── s-727255632.map ├── .idea ├── dictionaries │ └── stevenzwzhai.xml └── vcs.xml ├── .travis.yml ├── README.md ├── index.html ├── manifest.json ├── package.json ├── pwa ├── index.html ├── logo.png ├── manifest.json └── sw.js ├── src ├── App.vue ├── api │ ├── API.js │ ├── config.js │ └── mock.js ├── assets │ └── logo.png ├── components │ ├── app-list │ │ ├── added-list.vue │ │ ├── app-list.vue │ │ ├── dialog.vue │ │ ├── no-add-list.vue │ │ └── pages.vue │ └── nav │ │ └── nav.vue ├── main.js └── router.js ├── webpack.config.js └── webpack.dll.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /.happypack/cache--1.json: -------------------------------------------------------------------------------- 1 | {"context":{"loaders":[{"path":"E:\\workspace\\my-app\\my-app\\node_modules\\.0.13.1@style-loader\\index.js"},{"path":"E:\\workspace\\my-app\\my-app\\node_modules\\.0.25.0@css-loader\\index.js"},{"path":"E:\\workspace\\my-app\\my-app\\node_modules\\.6.2.8@babel-loader\\lib\\index.js"}],"external":{}},"mtimes":{"E:\\workspace\\my-app\\my-app\\src\\main.js":{"mtime":1481113490035,"compiledPath":"E:\\workspace\\my-app\\my-app\\.happypack\\s-1669978561","error":null}}} -------------------------------------------------------------------------------- /.happypack/cache--css.json: -------------------------------------------------------------------------------- 1 | {"context":{"loaders":[{"path":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/style-loader/index.js","request":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/style-loader/index.js"},{"path":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/css-loader/index.js","request":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/css-loader/index.js"}],"external":{}},"mtimes":{"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/element-ui/lib/theme-default/index.css":{"mtime":1502252614000,"compiledPath":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/.happypack/s-311568310","error":null}}} -------------------------------------------------------------------------------- /.happypack/cache--js.json: -------------------------------------------------------------------------------- 1 | {"context":{"loaders":[{"path":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/babel-loader/lib/index.js","request":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/node_modules/babel-loader/lib/index.js"}],"external":{}},"mtimes":{"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/src/main.js":{"mtime":1502893092000,"compiledPath":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/.happypack/s--1628562441","error":null},"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/src/api/API.js":{"mtime":1502888606000,"compiledPath":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/.happypack/s--1515862835","error":null},"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/src/api/config.js":{"mtime":1502892503000,"compiledPath":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/.happypack/s-155438370","error":null},"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/src/api/mock.js":{"mtime":1502897279000,"compiledPath":"/Users/stevenzwzhai/workspace/vue/vue2.0-elementUI-axios-vueRouter/.happypack/s--397098072","error":null}}} -------------------------------------------------------------------------------- /.happypack/s--1127144070: -------------------------------------------------------------------------------- 1 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 2 | 3 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4 | 5 | import axios from 'axios'; 6 | import config from './config'; 7 | 8 | // axios(config); 9 | 10 | var API = function () { 11 | function API() { 12 | _classCallCheck(this, API); 13 | } 14 | 15 | _createClass(API, [{ 16 | key: 'get', 17 | 18 | //获取已授权列表 19 | value: function get(param) { 20 | config.data.strSQL = param.param; 21 | return axios.post(param.api, {}, config); 22 | } 23 | //添加授权 24 | 25 | }, { 26 | key: 'post', 27 | value: function post(param) { 28 | config.data.strSQL = param.param; 29 | return axios.post(param.api, {}, config); 30 | } 31 | }, { 32 | key: 'reqSuccess', 33 | value: function reqSuccess(obj, msg) { 34 | obj.$message({ 35 | message: msg, 36 | type: 'success' 37 | }); 38 | } 39 | }, { 40 | key: 'reqFail', 41 | value: function reqFail(obj, msg) { 42 | obj.$message({ 43 | message: msg, 44 | type: 'success' 45 | }); 46 | } 47 | }]); 48 | 49 | return API; 50 | }(); 51 | 52 | export default API; -------------------------------------------------------------------------------- /.happypack/s--1127144070.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["E:\\workspace\\my-app\\my-app\\src\\api\\API.js"],"names":["axios","config","API","param","data","strSQL","post","api","obj","msg","$message","message","type"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,UAAnB;;AAEA;;IACMC,G;;;;;;;;AACL;sBACKC,K,EAAO;AACXF,UAAOG,IAAP,CAAYC,MAAZ,GAAqBF,MAAMA,KAA3B;AACA,UAAOH,MAAMM,IAAN,CAAWH,MAAMI,GAAjB,EAAqB,EAArB,EAAwBN,MAAxB,CAAP;AACA;AACD;;;;uBACME,K,EAAO;AACZF,UAAOG,IAAP,CAAYC,MAAZ,GAAqBF,MAAMA,KAA3B;AACA,UAAOH,MAAMM,IAAN,CAAWH,MAAMI,GAAjB,EAAqB,EAArB,EAAwBN,MAAxB,CAAP;AACA;;;6BACUO,G,EAAIC,G,EAAI;AACjBD,OAAIE,QAAJ,CAAa;AACJC,aAASF,GADL;AAEJG,UAAM;AAFF,IAAb;AAID;;;0BACOJ,G,EAAIC,G,EAAI;AACdD,OAAIE,QAAJ,CAAa;AACJC,aAASF,GADL;AAEJG,UAAM;AAFF,IAAb;AAID;;;;;;AAEF,eAAeV,GAAf","file":"API.js","sourceRoot":"E:/workspace/my-app/my-app","sourcesContent":["import axios from 'axios'\r\nimport config from './config'\r\n\r\n// axios(config);\r\nclass API {\r\n\t//获取已授权列表\r\n\tget (param) {\r\n\t\tconfig.data.strSQL = param.param;\r\n\t\treturn axios.post(param.api,{},config);\r\n\t}\r\n\t//添加授权\r\n\tpost (param) {\r\n\t\tconfig.data.strSQL = param.param;\r\n\t\treturn axios.post(param.api,{},config);\r\n\t}\r\n\treqSuccess(obj,msg){\r\n\t\t\tobj.$message({\r\n \t\tmessage: msg,\r\n \t\ttype: 'success'\r\n \t});\r\n\t}\r\n\treqFail(obj,msg){\r\n\t\t\tobj.$message({\r\n \t\tmessage: msg,\r\n \t\ttype: 'success'\r\n \t});\r\n\t}\r\n}\r\nexport default API;"]} -------------------------------------------------------------------------------- /.happypack/s--1234760282: -------------------------------------------------------------------------------- 1 | var __vue_exports__, __vue_options__ 2 | var __vue_styles__ = {} 3 | 4 | /* styles */ 5 | require("!!vue-loader/node_modules/vue-style-loader!css-loader?sourceMap!vue-loader/lib/style-rewriter?id=data-v-211698c9!vue-loader/lib/selector?type=styles&index=0!./App.vue") 6 | 7 | /* script */ 8 | __vue_exports__ = require("!!babel-loader!vue-loader/lib/selector?type=script&index=0!./App.vue") 9 | 10 | /* template */ 11 | var __vue_template__ = require("!!vue-loader/lib/template-compiler?id=data-v-211698c9!vue-loader/lib/selector?type=template&index=0!./App.vue") 12 | __vue_options__ = __vue_exports__ = __vue_exports__ || {} 13 | if ( 14 | typeof __vue_exports__.default === "object" || 15 | typeof __vue_exports__.default === "function" 16 | ) { 17 | if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")} 18 | __vue_options__ = __vue_exports__ = __vue_exports__.default 19 | } 20 | if (typeof __vue_options__ === "function") { 21 | __vue_options__ = __vue_options__.options 22 | } 23 | __vue_options__.__file = "E:\\workspace\\my-app\\my-app\\src\\App.vue" 24 | __vue_options__.render = __vue_template__.render 25 | __vue_options__.staticRenderFns = __vue_template__.staticRenderFns 26 | 27 | /* hot reload */ 28 | if (module.hot) {(function () { 29 | var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api") 30 | hotAPI.install(require("vue"), false) 31 | if (!hotAPI.compatible) return 32 | module.hot.accept() 33 | if (!module.hot.data) { 34 | hotAPI.createRecord("data-v-211698c9", __vue_options__) 35 | } else { 36 | hotAPI.reload("data-v-211698c9", __vue_options__) 37 | } 38 | })()} 39 | if (__vue_options__.functional) {console.error("[vue-loader] App.vue: functional components are not supported and should be defined in plain js files using render functions.")} 40 | 41 | module.exports = __vue_exports__ 42 | -------------------------------------------------------------------------------- /.happypack/s--1234760282.map: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /.happypack/s--1431284809: -------------------------------------------------------------------------------- 1 | // style-loader: Adds some css to the DOM by adding a 70 | -------------------------------------------------------------------------------- /src/api/API.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import config from './config' 3 | 4 | // axios(config); 5 | class API { 6 | //获取已授权列表 7 | get (param) { 8 | config.data.strSQL = param.param; 9 | return axios.post(param.api,{},config); 10 | } 11 | //添加授权 12 | post (param) { 13 | config.data.strSQL = param.param; 14 | return axios.post(param.api,{},config); 15 | } 16 | reqSuccess(obj,msg){ 17 | obj.$message({ 18 | message: msg, 19 | type: 'success' 20 | }); 21 | } 22 | reqFail(obj,msg){ 23 | obj.$message({ 24 | message: msg, 25 | type: 'success' 26 | }); 27 | } 28 | } 29 | export default API; -------------------------------------------------------------------------------- /src/api/config.js: -------------------------------------------------------------------------------- 1 | import Qs from 'qs' 2 | export default{ 3 | 4 | url: '/get', 5 | 6 | 7 | baseURL: 'http://www.jiekou.cn', 8 | method: 'POST', 9 | 10 | transformRequest: [ 11 | function(data) { 12 | //为了避免qs格式化时对内层对象的格式化先把内层的对象转为 13 | data.strSQL = base64encode(data.strSQL); 14 | //由于使用的form-data传数据所以要格式化 15 | data = Qs.stringify(data); 16 | return data; 17 | } 18 | ], 19 | 20 | 21 | transformResponse: [ 22 | function(data) { 23 | 24 | return data; 25 | } 26 | ], 27 | 28 | headers: { 29 | 'Content-Type':'application/x-www-form-urlencoded' 30 | }, 31 | 32 | 33 | params: { 34 | 35 | }, 36 | 37 | 38 | paramsSerializer: function(params) { 39 | return Qs.stringify(params) 40 | }, 41 | 42 | 43 | data: { 44 | eid: "514403", 45 | currentPage:1, 46 | ItemsOfPage:99999, 47 | type:0, 48 | strSQL:"" 49 | }, 50 | 51 | 52 | timeout: 5000, 53 | 54 | 55 | withCredentials: false, // default 56 | 57 | 58 | responseType: 'json', // default 59 | 60 | 61 | //将upload事件注释掉,防止跨域状态下发起option请求 62 | 63 | // onUploadProgress: function(progressEvent) { 64 | // // Do whatever you want with the native progress event 65 | // }, 66 | 67 | 68 | // onDownloadProgress: function(progressEvent) { 69 | // // Do whatever you want with the native progress event 70 | // }, 71 | 72 | 73 | maxContentLength: 2000, 74 | 75 | 76 | validateStatus: function(status) { 77 | return status >= 200 && status < 300; // default 78 | }, 79 | 80 | 81 | maxRedirects: 5, // default 82 | } 83 | 84 | function base64encode(str) { 85 | var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 86 | var output = ""; 87 | var chr1, chr2, chr3 = ""; 88 | var enc1, enc2, enc3, enc4 = ""; 89 | var i = 0; 90 | var input = utf16to8(str); 91 | do { 92 | chr1 = input.charCodeAt(i++); 93 | chr2 = input.charCodeAt(i++); 94 | chr3 = input.charCodeAt(i++); 95 | enc1 = chr1 >> 2; 96 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 97 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 98 | enc4 = chr3 & 63; 99 | if (isNaN(chr2)) { 100 | enc3 = enc4 = 64; 101 | } else if (isNaN(chr3)) { 102 | enc4 = 64; 103 | } 104 | output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); 105 | chr1 = chr2 = chr3 = ""; 106 | enc1 = enc2 = enc3 = enc4 = ""; 107 | } while (i < input.length); 108 | return output; 109 | 110 | } 111 | 112 | function utf16to8(str) { 113 | var out, i, len, c; 114 | out = ""; 115 | len = str.length; 116 | for (i = 0; i < len; i++) { 117 | c = str.charCodeAt(i); 118 | if ((c >= 0x0001) && (c <= 0x007F)) { 119 | out += str.charAt(i); 120 | } else if (c > 0x07FF) { 121 | out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); 122 | out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); 123 | out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); 124 | } else { 125 | out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); 126 | out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); 127 | } 128 | } 129 | return out; 130 | } 131 | -------------------------------------------------------------------------------- /src/api/mock.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by stevenzwzhai on 2017/8/16. 3 | */ 4 | import Mock from 'mockjs' 5 | 6 | const baseUrl = "http://www.jiekou.cn/" 7 | const Random = Mock.Random 8 | export default function(){ 9 | //首页数据 10 | Mock.mock(`${baseUrl}getdbdata2`, { 11 | "data":Array(10).fill(1).map(() => { 12 | return { 13 | appname:Random.last(), 14 | cmpname:Random.first(), 15 | devname:Random.cname(), 16 | mobile:Random.integer(15000000000, 15999999999), 17 | email:Random.email(), 18 | desc:Random.sentence( 7, 12 ), 19 | icon:Random.dataImage('88x31') 20 | } 21 | }) 22 | }); 23 | //未添加应用列表 24 | Mock.mock(`${baseUrl}getdbdata3`, { 25 | "data":Array(10).fill(1).map(() => { 26 | return { 27 | appname:Random.last(), 28 | cmpname:Random.first(), 29 | devname:Random.cname(), 30 | mobile:Random.integer(15000000000, 15999999999), 31 | email:Random.email(), 32 | desc:Random.sentence( 7, 12 ), 33 | icon:Random.dataImage('88x31') 34 | } 35 | }) 36 | }); 37 | //手机列表1 38 | Mock.mock(`${baseUrl}getdbdata4`, { 39 | "data":Array(10).fill(1).map(() => { 40 | return { 41 | username:Random.last(), 42 | mobile:Random.integer(18000000000, 18999999999), 43 | } 44 | }) 45 | }); 46 | //手机列表2 47 | Mock.mock(`${baseUrl}getdbdata5`, { 48 | "data":Array(10).fill(1).map(() => { 49 | return { 50 | username:Random.last(), 51 | mobile:Random.integer(13000000000, 13999999999), 52 | } 53 | }) 54 | }); 55 | } 56 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stevenzwzhai/vue2.0-elementUI-axios-vueRouter/b940b5d654f781adadf80210d38c8e8af92786a1/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/app-list/added-list.vue: -------------------------------------------------------------------------------- 1 | 63 | 136 | -------------------------------------------------------------------------------- /src/components/app-list/app-list.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 66 | -------------------------------------------------------------------------------- /src/components/app-list/dialog.vue: -------------------------------------------------------------------------------- 1 | 71 | 203 | -------------------------------------------------------------------------------- /src/components/app-list/no-add-list.vue: -------------------------------------------------------------------------------- 1 | 73 | 117 | -------------------------------------------------------------------------------- /src/components/app-list/pages.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /src/components/nav/nav.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 28 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import ElementUI from 'element-ui' 4 | import 'element-ui/lib/theme-default/index.css' 5 | import VueRouter from 'vue-router' 6 | import mock from './api/mock' 7 | // import routes from './router' 8 | Vue.use(ElementUI) 9 | Vue.use(VueRouter) 10 | mock(); 11 | 12 | import AppList from './components/app-list/app-list.vue' 13 | const routes=[ 14 | { 15 | path:"/", 16 | component:AppList 17 | } 18 | ]; 19 | const router = new VueRouter({ 20 | routes 21 | }); 22 | 23 | 24 | new Vue({ 25 | 26 | router, 27 | render: h => h(App) 28 | }).$mount('#app'); 29 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import AppList from './components/app-list/app-list.vue' 2 | export default{ 3 | routes:[ 4 | { 5 | path:'/', 6 | component:"AppList" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | var HappyPack = require('happypack'); 4 | var os=require('os'); 5 | var happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length }); 6 | console.log(os); 7 | module.exports = { 8 | entry: './src/main.js', 9 | output: { 10 | path: path.resolve(__dirname, './dist'), 11 | publicPath: '/dist/', 12 | filename: 'build.js' 13 | }, 14 | module: { 15 | rules: [{ 16 | test: /\.vue$/, 17 | loader: 'vue-loader', 18 | options: { 19 | // vue-loader options go here 20 | } 21 | }, { 22 | test: /\.css$/, 23 | loader: 'happypack/loader?id=css', 24 | }, { 25 | test:/\.scss/, 26 | loader:'style-loader!css-loader!sass-loader', 27 | exclude:/node_modules/ 28 | }, { 29 | test: /\.js$/, 30 | loader: 'happypack/loader?id=js', 31 | exclude: /node_modules/ 32 | 33 | }, { 34 | test: /\.(png|jpg|gif|svg)$/, 35 | loader: 'file-loader', 36 | options: { 37 | name: '[name].[ext]?[hash]' 38 | } 39 | }, 40 | { 41 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 42 | loader: 'url-loader', 43 | options:{ 44 | name:'fonts/[hash].[ext]' 45 | } 46 | }] 47 | }, 48 | resolve: { 49 | alias: { 50 | 'vue$': 'vue/dist/vue.js' 51 | } 52 | }, 53 | devServer: { 54 | historyApiFallback: true, 55 | noInfo: true 56 | }, 57 | devtool: '#eval-source-map', 58 | plugins:[ 59 | new HappyPack({ 60 | id:'js', 61 | loaders: ['babel-loader'], 62 | threadPool: happyThreadPool, 63 | cache: true, 64 | verbose: true 65 | }), 66 | new HappyPack({ 67 | id:'css', 68 | loaders: ['style-loader!css-loader'], 69 | threadPool: happyThreadPool, 70 | cache: true, 71 | verbose: true 72 | }) 73 | ] 74 | } 75 | 76 | if (process.env.NODE_ENV === 'production') { 77 | module.exports.devtool = '#source-map' 78 | // http://vue-loader.vuejs.org/en/workflow/production.html 79 | module.exports.plugins = (module.exports.plugins || []).concat([ 80 | new webpack.DefinePlugin({ 81 | 'process.env': { 82 | NODE_ENV: '"production"' 83 | } 84 | }), 85 | new webpack.optimize.UglifyJsPlugin({ 86 | sourceMap: true, 87 | compress: { 88 | warnings: false 89 | } 90 | }), 91 | new webpack.LoaderOptionsPlugin({ 92 | minimize: true 93 | }), 94 | new webpack.DllReferencePlugin({ 95 | context: __dirname, 96 | /** 97 | * 在这里引入 manifest 文件 98 | */ 99 | manifest: require('./manifest.json') 100 | }) 101 | ]) 102 | } -------------------------------------------------------------------------------- /webpack.dll.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | 4 | module.exports = { 5 | entry:{ 6 | vender:['vue-router','axios','element-ui'] 7 | }, 8 | output: { 9 | path: path.join(__dirname, 'dist'), 10 | filename: '[name].js', 11 | library: '[name]', 12 | }, 13 | module: { 14 | rules: [ 15 | { 16 | test:/\.json$/, 17 | loader:'json-loader', 18 | include:/node_modules/ 19 | }, 20 | { 21 | test: /\.css$/, 22 | loader: 'style-loader!css-loader', 23 | }, { 24 | test: /\.(png|jpg|gif|svg)$/, 25 | loader: 'file-loader', 26 | options: { 27 | name: '[name].[ext]?[hash]' 28 | } 29 | }, 30 | { 31 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 32 | loader: 'url-loader', 33 | options:{ 34 | name:'fonts/[hash].[ext]' 35 | } 36 | }] 37 | }, 38 | plugins:[ 39 | new webpack.DllPlugin({ 40 | path: 'manifest.json', 41 | name: '[name]', 42 | context: __dirname, 43 | }) 44 | ] 45 | } --------------------------------------------------------------------------------