From 26adbc92be1c8ce5ce6f93302fb806058ef087cf Mon Sep 17 00:00:00 2001 From: Vben Date: Mon, 12 Apr 2021 23:00:35 +0800 Subject: [PATCH] fix: fix dark theme refreshing flashing white screen --- CHANGELOG.zh_CN.md | 6 +++ package.json | 18 ++++---- src/App.vue | 5 -- src/main.ts | 7 ++- yarn.lock | 112 +++++++++++++++++++++++++++------------------ 5 files changed, 87 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 6f788e775f7..3b7ef69e854 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -1,3 +1,9 @@ +## Wip + +### 🐛 Bug Fixes + +- 修复黑暗主题刷新闪烁的白屏 + ## 2.3.0 (2021-04-10) ## (破坏性更新) Breaking changes diff --git a/package.json b/package.json index 865ce14715b..225609c8750 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "mockjs": "^1.1.0", "nprogress": "^0.2.0", "path-to-regexp": "^6.2.0", - "pinia": "^2.0.0-alpha.12", + "pinia": "2.0.0-alpha.13", "print-js": "^1.6.0", "qrcode": "^1.4.4", "sortablejs": "^1.13.0", @@ -58,10 +58,10 @@ "devDependencies": { "@commitlint/cli": "^12.1.1", "@commitlint/config-conventional": "^12.1.1", - "@iconify/json": "^1.1.327", + "@iconify/json": "^1.1.328", "@purge-icons/generated": "^0.7.0", "@types/crypto-js": "^4.0.1", - "@types/fs-extra": "^9.0.10", + "@types/fs-extra": "^9.0.11", "@types/inquirer": "^7.3.1", "@types/lodash-es": "^4.17.4", "@types/mockjs": "^1.0.3", @@ -84,7 +84,7 @@ "eslint-config-prettier": "^8.1.0", "eslint-define-config": "^1.0.7", "eslint-plugin-prettier": "^3.3.1", - "eslint-plugin-vue": "^7.8.0", + "eslint-plugin-vue": "^7.9.0", "esno": "^0.5.0", "fs-extra": "^9.1.0", "http-server": "^0.12.3", @@ -93,11 +93,11 @@ "is-ci": "^3.0.0", "less": "^4.1.1", "lint-staged": "^10.5.4", - "postcss": "^8.2.9", + "postcss": "^8.2.10", "prettier": "^2.2.1", "pretty-quick": "^3.1.0", "rimraf": "^3.0.2", - "rollup-plugin-visualizer": "5.3.0", + "rollup-plugin-visualizer": "5.3.4", "stylelint": "^13.12.0", "stylelint-config-prettier": "^8.0.2", "stylelint-config-standard": "^21.0.0", @@ -113,15 +113,15 @@ "vite-plugin-pwa": "^0.7.0", "vite-plugin-style-import": "^0.9.2", "vite-plugin-svg-icons": "^0.4.1", - "vite-plugin-theme": "^0.6.5", - "vite-plugin-windicss": "0.13.2", + "vite-plugin-theme": "^0.7.0", + "vite-plugin-windicss": "0.14.0", "vue-eslint-parser": "^7.6.0" }, "resolutions": { "//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it", "bin-wrapper": "npm:bin-wrapper-china", "rollup": "^2.45.1", - "esbuild": "^0.11.7" + "esbuild": "^0.11.9" }, "repository": { "type": "git", diff --git a/src/App.vue b/src/App.vue index 64e62035763..9515036f351 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,6 @@ import { ConfigProvider } from 'ant-design-vue'; import { AppProvider } from '/@/components/Application'; - import { initAppConfigStore } from '/@/logics/initAppConfig'; - import { useLockPage } from '/@/hooks/web/useLockPage'; import { useTitle } from '/@/hooks/web/useTitle'; import { useLocale } from '/@/locales/useLocale'; @@ -21,9 +19,6 @@ name: 'App', components: { ConfigProvider, AppProvider }, setup() { - // Initialize vuex internal system configuration - initAppConfigStore(); - useTitle(); // support Multi-language diff --git a/src/main.ts b/src/main.ts index d43ffb577d9..cfddc35caad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,9 @@ import '/@/design/index.less'; -import '@virtual/windi.css'; +import 'virtual:windi.css'; import { createApp } from 'vue'; import App from './App.vue'; - +import { initAppConfigStore } from '/@/logics/initAppConfig'; import router, { setupRouter } from '/@/router'; import { setupRouterGuard } from '/@/router/guard'; import { setupStore } from '/@/store'; @@ -29,6 +29,9 @@ if (import.meta.env.DEV) { // Configure vuex store setupStore(app); + // Initialize vuex internal system configuration + initAppConfigStore(); + // Register global components registerGlobComp(app); diff --git a/yarn.lock b/yarn.lock index 54997449433..463a468175d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1108,10 +1108,10 @@ dependencies: cross-fetch "^3.0.6" -"@iconify/json@^1.1.327": - version "1.1.327" - resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.327.tgz#78d021a7f730c01863e56ee5b4c0eaf4ca69db43" - integrity sha512-S4Zw/5yqQaGpkYe8ubB+0PRXQl5UZOdsYhvShzI2FSqOjwjhpPG4X6DUTH6WD8oGkCpRa/B7tK9asYefjCax7w== +"@iconify/json@^1.1.328": + version "1.1.328" + resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.328.tgz#2fba6768ae3f148c315f205a94409e86dbf07cca" + integrity sha512-/dVvFNpktwCx2A3aA+/fLJ88jXTAh42VZE79FzaaY5CmgmHjvenpSOP1p1oy2m3XM8VtsDBoNM+RKFIIOYL2bg== "@intlify/core-base@9.0.0": version "9.0.0" @@ -1298,10 +1298,10 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/fs-extra@^9.0.10": - version "9.0.10" - resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.10.tgz#8023a72e3d06cf54929ea47ec7634e47f33f4046" - integrity sha512-O9T2LLkRDiTlalOBdjEkcnT0MRdT2+wglCl7pJUJ3mkWkR8hX4K+5bg2raQNJcLv4V8zGuTXe7Ud3wSqkTyuyQ== +"@types/fs-extra@^9.0.11": + version "9.0.11" + resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.11.tgz#8cc99e103499eab9f347dbc6ca4e99fb8d2c2b87" + integrity sha512-mZsifGG4QeQ7hlkhO56u7zt/ycBgGxSVsFI/6lGTU34VtwkiqrrSDgw0+ygs8kFGWcXnFQWMrzF2h7TtDFNixA== dependencies: "@types/node" "*" @@ -1696,18 +1696,18 @@ dependencies: vue-demi latest -"@windicss/plugin-utils@0.13.2": - version "0.13.2" - resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.13.2.tgz#8df77495f38002edb9a92503a7a9dab99c773c1b" - integrity sha512-ZnHIPhyHSCYmkc3dcytSkTq3fchzCIvNsiptzP5twtK1Q7aWRNrOpPDywer64goWOBYHJIgCp8GFgzFSden3jw== +"@windicss/plugin-utils@0.14.0": + version "0.14.0" + resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.14.0.tgz#ca5459e81d38fbe3c1eac0574ffdc8dba06961a4" + integrity sha512-PnXKrCX7dl3tQPkfc2RGOQCqzS+3ApTLelGhr0c1kbHgz+EjaS+pK9vhhQm/8xgzyJLyreYUuQEEAvvPtBRBEQ== dependencies: debug "^4.3.2" fast-glob "^3.2.5" magic-string "^0.25.7" - micromatch "^4.0.2" + micromatch "^4.0.4" pirates "^4.0.1" sucrase "^3.17.1" - windicss "^2.5.12" + windicss "^2.5.14" "@zxcvbn-ts/core@^0.3.0": version "0.3.0" @@ -3596,10 +3596,10 @@ esbuild-register@^2.2.0: esbuild "^0.11.5" jsonc-parser "^3.0.0" -esbuild@^0.11.4, esbuild@^0.11.5, esbuild@^0.11.6, esbuild@^0.11.7, esbuild@^0.9.2, esbuild@^0.9.3: - version "0.11.7" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.11.7.tgz#c32ee844d3b0db489e62ea0ad028e109f6f205c7" - integrity sha512-rY+jA0TiCFVLcvxUbbp+yQ9EEBXDsfIU4rsY7RKJEsx/fjjRFjyGnamRCBwUZQspK37G9We6xAkX7IibGA24AA== +esbuild@^0.11.4, esbuild@^0.11.5, esbuild@^0.11.6, esbuild@^0.11.9, esbuild@^0.9.2, esbuild@^0.9.3: + version "0.11.9" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.11.9.tgz#408bf4fb5ae9abc2f27d56b62e19aab697687975" + integrity sha512-qP7w/oWjJBIh9x+H37DbpkMtmSnLm63VDyA06+vkJJEHlVR7QSDiPAaka7mtMQZHoBn87irUx5rDxbXMKaf8xw== escalade@^3.1.1: version "3.1.1" @@ -3633,10 +3633,10 @@ eslint-plugin-prettier@^3.3.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-vue@^7.8.0: - version "7.8.0" - resolved "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.8.0.tgz#cb0e85d65b65fa8d15e783fbb03c049d2c4cfdae" - integrity sha512-OGrnPz+PuYL2HmVyBHxm4mRjxW2kfFCQE6Hw9G6qOHs/Pcu0srOlCCW0FMa8SLzIEqxl8WuKoBSPcMnrjUG2vw== +eslint-plugin-vue@^7.9.0: + version "7.9.0" + resolved "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.9.0.tgz#f8e83a2a908f4c43fc8304f5401d4ff671f3d560" + integrity sha512-2Q0qQp5+5h+pZvJKCbG1/jCRUYrdgAz5BYKGyTlp2NU8mx09u3Hp7PsH6d5qef6ojuPoCXMnrbbDxeoplihrSw== dependencies: eslint-utils "^2.1.0" natural-compare "^1.4.0" @@ -6102,6 +6102,14 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.2.1" +micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + mime-db@^1.28.0: version "1.47.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" @@ -6858,6 +6866,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" + integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== + pify@^2.0.0, pify@^2.2.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -6873,10 +6886,10 @@ pify@^4.0.1: resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pinia@^2.0.0-alpha.12: - version "2.0.0-alpha.12" - resolved "https://registry.npmjs.org/pinia/-/pinia-2.0.0-alpha.12.tgz#690e9a7b4c176bb9d95fe0dc8ec4ab8847b09493" - integrity sha512-qmcDpuoAwxQKAVp7/cOkXFYDaja+vyXMWR6kvdyzeJcGGMvZf1HQ2xFhUSW5lf1eW5IiQP0cBRdF3ZDyVa+JIQ== +pinia@2.0.0-alpha.13: + version "2.0.0-alpha.13" + resolved "https://registry.npmjs.org/pinia/-/pinia-2.0.0-alpha.13.tgz#d48e6efec11d38201e20770bc02b168e2157a9f7" + integrity sha512-3r9fpUi5Uai48vjeTXzcHAvlDjYvx/9mNtWiO5QyWy4zqfn7YjvOiBCHXH9r1jwo4LakZzG/ppr5i6sr/63fYQ== pinkie-promise@^2.0.0: version "2.0.1" @@ -7075,7 +7088,7 @@ postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.2 source-map "^0.6.1" supports-color "^6.1.0" -postcss@^8.1.10, postcss@^8.2.1, postcss@^8.2.9: +postcss@^8.1.10, postcss@^8.2.1: version "8.2.9" resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz#fd95ff37b5cee55c409b3fdd237296ab4096fba3" integrity sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q== @@ -7084,6 +7097,15 @@ postcss@^8.1.10, postcss@^8.2.1, postcss@^8.2.9: nanoid "^3.1.22" source-map "^0.6.1" +postcss@^8.2.10: + version "8.2.10" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.10.tgz#ca7a042aa8aff494b334d0ff3e9e77079f6f702b" + integrity sha512-b/h7CPV7QEdrqIxtAf2j31U5ef05uBDuvoXv6L51Q4rcS1jdlXAVKJv+atCFdUXYl9dyTHGyoMzIepwowRJjFw== + dependencies: + colorette "^1.2.2" + nanoid "^3.1.22" + source-map "^0.6.1" + posthtml-parser@^0.2.0, posthtml-parser@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.2.1.tgz#35d530de386740c2ba24ff2eb2faf39ccdf271dd" @@ -7617,10 +7639,10 @@ rollup-plugin-terser@^7.0.0: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup-plugin-visualizer@5.3.0: - version "5.3.0" - resolved "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.3.0.tgz#2aafea2626f430a5eb84cf4a42b2f01948a4681b" - integrity sha512-beMaHDF1BgqYLY7URjSzawzQP/sBi+1cnInwXOsUdkWy84VZNQRXanitfmdz0lkSKupkE/KtiU61qbedAU5Kfg== +rollup-plugin-visualizer@5.3.4: + version "5.3.4" + resolved "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.3.4.tgz#216300acca6e31b139be92eed98280c5662a5818" + integrity sha512-n3wYwKrZ3nhYJj8apzFuxmiu4y+ygDNJYLqQCOxludg3Pnhkql9WYc8iupgsMI+jGREA0dFsfDlzDAKcmXZIMQ== dependencies: nanoid "^3.1.22" open "^7.4.2" @@ -9112,10 +9134,10 @@ vite-plugin-svg-icons@^0.4.1: svg-baker "1.7.0" svgo "^2.3.0" -vite-plugin-theme@^0.6.4: - version "0.6.4" - resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.4.tgz#51376c328d708aa30ce56031ff4d7dd02cca613f" - integrity sha512-GoXSDHjmDNU2R6bmuyr67VqI5dekGSejNMzlGTivMOmNl516464ATmV5NtoCDNiPJ1QYYnMRjZSQNfZ/Fxl7Qg== +vite-plugin-theme@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.7.0.tgz#287fb37de9edc612c9731b6fa84ee78a123d061d" + integrity sha512-D7lQdQM7z0EGAPXIEFMTMNVRvdTTNl5pvksVjhHZb8VfQwTbIfYZuBnRDP1mRMuQH04oipBAAMJl3isn9j3jNg== dependencies: "@types/node" "^14.14.37" "@types/tinycolor2" "^1.4.2" @@ -9126,15 +9148,15 @@ vite-plugin-theme@^0.6.4: esbuild-plugin-alias "^0.1.2" tinycolor2 "^1.4.2" -vite-plugin-windicss@0.13.2: - version "0.13.2" - resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.13.2.tgz#c6390e42c4ceef2bd407fcbad8cab467ba695d87" - integrity sha512-yy9jncbjMl79hEnJC8F8UQhM3b+r9g+JDFtn1ximK0BZvMpS4UKBuayWjmmk9tb8/5I9W+H1osnrfhhlneLW1Q== +vite-plugin-windicss@0.14.0: + version "0.14.0" + resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.14.0.tgz#e2e1c2a14eff7a5a3c417c388e5d865fa6157967" + integrity sha512-f4Dgvpgq1i2rvqJ3He4gZ+BYrgz6OiQwHOLMOMU4RbyWY1Vr7gdNs71E/AbN2DWdkm+L/fj/4BNhvlp35I8+fw== dependencies: - "@windicss/plugin-utils" "0.13.2" + "@windicss/plugin-utils" "0.14.0" chalk "^4.1.0" debug "^4.3.2" - windicss "^2.5.12" + windicss "^2.5.14" vite@2.1.5: version "2.1.5" @@ -9246,10 +9268,10 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -windicss@^2.5.12: - version "2.5.12" - resolved "https://registry.npmjs.org/windicss/-/windicss-2.5.12.tgz#7bc469b05d7a8fa3905d49d6521a1ff9107d0ea4" - integrity sha512-BZ0Ps1C0RlCHBVOPcw/DAReeR9o/mKaoFgkBsVphQ23M5nsvVfVXgGlNJZssjAQsXnlDpj97pnIhtDn1ENBjXw== +windicss@^2.5.14: + version "2.5.14" + resolved "https://registry.npmjs.org/windicss/-/windicss-2.5.14.tgz#41236ccc2517c0947e1adb69e0d5e8aa9bed9c1e" + integrity sha512-8Lm7U1M5AzJPbiaVSVz7qWdETRzlkv//5LBMICBBAojos1jo09lUGhNZ5rBzHeldB9JmqYMDOGgrrXHExu0EAg== wmf@~1.0.1: version "1.0.2"