From b72d7254208d4eefeebcaf6d5d21fd6c83c253e3 Mon Sep 17 00:00:00 2001 From: xiaoluoboding Date: Mon, 23 Dec 2019 14:54:03 +0800 Subject: [PATCH] fix: document.body.removeAttribute will remove the class attribute bug --- src/packages/SmartWidget.vue | 2 +- vue.config.js | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/packages/SmartWidget.vue b/src/packages/SmartWidget.vue index c2778fb..7e8a324 100644 --- a/src/packages/SmartWidget.vue +++ b/src/packages/SmartWidget.vue @@ -237,7 +237,7 @@ export default { this.widgetBodyOffsetHeight = this.widgetBodyOldHeight // restore collapsed state this.isFullScreenCollapsed = this.isFullScreen - document.body.removeAttribute('class', 'no-overflow') + document.body.classList.remove('no-overflow') } this.$emit('on-fullscreen', this.isFullScreen) }, diff --git a/vue.config.js b/vue.config.js index bebeea1..8322e9c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -5,10 +5,8 @@ const isLib = process.env.VUE_APP_BUILD_MODE === 'lib' const resolve = dir => path.join(__dirname, dir) const setChainWebpack = config => { - // 修改默认目录简写 config.resolve.alias .set('@', path.resolve('app')) - // 添加对 app 目录的支持 config.module .rule('js') .include @@ -18,11 +16,6 @@ const setChainWebpack = config => { .loader('babel-loader') if (isProd) { - /** - * 清除性能警告 - * entrypoint size limit (244 KiB) - * asset size limit (244 KiB) - */ config.performance .set('maxEntrypointSize', 2500000) .set('maxAssetSize', 2000000) @@ -48,7 +41,7 @@ module.exports = { publicPath: './', pages: { index: { - entry: resolve('app/main.js') // 修改默认打包文件入口 + entry: resolve('app/main.js') } }, lintOnSave: true,