From 28d9817885da7a930b23829119cd5b2870346d77 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sun, 18 Nov 2018 11:07:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 30723ec95813747dbd55054b42d7b480489b2ab0 [formerly 30723ec95813747dbd55054b42d7b480489b2ab0 [formerly 30723ec95813747dbd55054b42d7b480489b2ab0 [formerly 30723ec95813747dbd55054b42d7b480489b2ab0 [formerly 00103fb3d8da9c47bb9a7ede036a0aacd75efcd8 [formerly 033b78abeacaf34e7b49bf7737757fd31b4e0389]]]]] Former-commit-id: 6cce6f23a44636b918dc98ca3398c01165158143 Former-commit-id: b53123a9ce1e9a27b6108955eef6d52d4cce11ad Former-commit-id: 353dbb0ad9d402ad10c082a442e32b9edd89b076 [formerly da553cc21680df7ac5a9baf7416fe9dbf840ad32] Former-commit-id: 6b5a9da647f6d5467682bc42c568a52422bbe61d Former-commit-id: 9e64087cfd10811375f0afb5e50a27ba4ddf7aee Former-commit-id: e791cca914171ee88101e28585068a7e600ef199 Former-commit-id: 31a432c983a493278037032ad2963b4fd67e3b70 Former-commit-id: b9242379f9958374fe9eecee97d6bb56e1ab6a67 --- vue.config.js | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/vue.config.js b/vue.config.js index f3d63c54..4b75d773 100644 --- a/vue.config.js +++ b/vue.config.js @@ -34,23 +34,30 @@ module.exports = { // 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559 config.resolve .symlinks(true) - if (process.env.NODE_ENV === 'production') { - config.optimization - // 生产环境移除 console - // 其它优化选项 https://segmentfault.com/a/1190000008995453?utm_source=tag-newest#articleHeader12 - .minimizer([ - new UglifyJsPlugin({ - uglifyOptions: { - compress: { - warnings: false, - drop_console: true, - drop_debugger: true, - pure_funcs: ['console.log'] + config + // 开发环境 + .when(process.env.NODE_ENV === 'development', + // sourcemap不包含列信息 + config => config.devtool('cheap-source-map') + ) + // 非开发环境 + .when(process.env.NODE_ENV !== 'development', config => { + config.optimization + .minimizer([ + new UglifyJsPlugin({ + uglifyOptions: { + // 移除 console + // 其它优化选项 https://segmentfault.com/a/1190000010874406 + compress: { + warnings: false, + drop_console: true, + drop_debugger: true, + pure_funcs: ['console.log'] + } } - } - }) - ]) - } + }) + ]) + }) // markdown config.module .rule('md') From 7b9a90b1bf37198bc2e698991731923882828268 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sun, 18 Nov 2018 11:07:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: ab1ca6f7401b5bf897d8f87f82c4ce51cb994d2c [formerly ab1ca6f7401b5bf897d8f87f82c4ce51cb994d2c [formerly ab1ca6f7401b5bf897d8f87f82c4ce51cb994d2c [formerly ab1ca6f7401b5bf897d8f87f82c4ce51cb994d2c [formerly 5782f0846ddebaedf4b557c4b8f57aa983e493de [formerly f82dde1e98c6150bbe8a5668f3546aab6cec1d8d]]]]] Former-commit-id: c6135736c173a62ed1a2f8f8c1da323ecd62a972 Former-commit-id: f31cb5e781ebd6e3b895f57c0ac2ac7011ef67d5 Former-commit-id: 2e182dd704e83fb802602dec7c333080548e196b [formerly 671e3c40bbaaa47d9512ae769c1abb45c5a0f519] Former-commit-id: ae19d89b29495b94e2778c27447e75bd809ad731 Former-commit-id: a465236e09135150b609910a35e162f9979d4c5d Former-commit-id: 4152ca266db7754572f6e6a4749173e896f83860 Former-commit-id: d4e6fd4aac11e52990b8eae8b289509d00a18c18 Former-commit-id: 3b70ec077a0c9c1d7d2899bf15259ae36656bf25 --- src/components/d2-container/components/mixins/bs.js | 2 +- src/pages/demo/d2-crud/index/index.vue | 1 - src/pages/demo/element/data-table/components/table13/index.vue | 2 +- src/pages/demo/plugins/index/index.vue | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/d2-container/components/mixins/bs.js b/src/components/d2-container/components/mixins/bs.js index 50a74723..51c44913 100644 --- a/src/components/d2-container/components/mixins/bs.js +++ b/src/components/d2-container/components/mixins/bs.js @@ -30,7 +30,7 @@ export default { } }, this.betterScrollOptions)) // 滚动时发出事件 并且统一返回的数据格式 - this.BS.on('scroll', ({x, y}) => this.$emit('scroll', { + this.BS.on('scroll', ({ x, y }) => this.$emit('scroll', { x: -x, y: -y })) diff --git a/src/pages/demo/d2-crud/index/index.vue b/src/pages/demo/d2-crud/index/index.vue index aef01a67..34162de4 100644 --- a/src/pages/demo/d2-crud/index/index.vue +++ b/src/pages/demo/d2-crud/index/index.vue @@ -17,4 +17,3 @@ export default { } } - diff --git a/src/pages/demo/element/data-table/components/table13/index.vue b/src/pages/demo/element/data-table/components/table13/index.vue index a915b6c1..eaf9b07b 100644 --- a/src/pages/demo/element/data-table/components/table13/index.vue +++ b/src/pages/demo/element/data-table/components/table13/index.vue @@ -37,7 +37,7 @@ - + -