From 0bdaf55ff1b4fe0e49ca8ea62d6ada706de18aca Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Fri, 7 Jan 2022 15:08:21 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=90=8C=E6=AD=A5=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E7=89=88=E5=88=86=E6=94=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 6 -- index.html | 89 +++++++++++++++++++++++------ package.json | 4 +- pnpm-lock.yaml | 47 ++++++++++----- src/layout/components/navbar.vue | 7 +-- src/layout/components/setting/index.vue | 2 +- src/layout/components/sidebar/hamBurger.vue | 7 +++ vite.config.ts | 3 + 8 files changed, 121 insertions(+), 44 deletions(-) delete mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 7e3c18b..0000000 --- a/babel.config.js +++ /dev/null @@ -1,6 +0,0 @@ -const productPlugins = []; -process.env.NODE_ENV === "production" && - productPlugins.push("transform-remove-console"); -module.exports = { - plugins: [...productPlugins] -}; diff --git a/index.html b/index.html index af58119..818ffa5 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ pure-admin-thin + @@ -14,35 +15,89 @@
-

Loading

+
Loading...
diff --git a/package.json b/package.json index 2161925..461cef8 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "mockjs": "^1.1.0", "nprogress": "^0.2.0", "path": "^0.12.7", - "pinia": "^2.0.0-rc.14", + "pinia": "^2.0.9", "qs": "^6.10.2", "remixicon": "^2.5.0", "resize-observer-polyfill": "^1.5.1", @@ -78,7 +78,6 @@ "@vue/eslint-config-typescript": "7.0.0", "@zougt/vite-plugin-theme-preprocessor": "^1.4.0", "autoprefixer": "10.2.4", - "babel-plugin-transform-remove-console": "6.9.4", "cross-env": "7.0.3", "eslint": "7.30.0", "eslint-plugin-prettier": "3.4.0", @@ -99,6 +98,7 @@ "typescript": "4.4.2", "unplugin-element-plus": "^0.1.3", "vite": "2.6.14", + "vite-plugin-full-reload": "^1.0.0", "vite-plugin-mock": "^2.9.6", "vite-plugin-style-import": "^1.2.1", "vite-svg-loader": "^2.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f2bfad..e229637 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,6 @@ specifiers: animate.css: ^4.1.1 autoprefixer: 10.2.4 axios: ^0.21.1 - babel-plugin-transform-remove-console: 6.9.4 cross-env: 7.0.3 css-color-function: ^1.3.3 dayjs: ^1.10.7 @@ -46,7 +45,7 @@ specifiers: mockjs: ^1.1.0 nprogress: ^0.2.0 path: ^0.12.7 - pinia: ^2.0.0-rc.14 + pinia: ^2.0.9 postcss: 8.2.6 postcss-import: 14.0.0 prettier: 2.3.2 @@ -66,6 +65,7 @@ specifiers: typescript: 4.4.2 unplugin-element-plus: ^0.1.3 vite: 2.6.14 + vite-plugin-full-reload: ^1.0.0 vite-plugin-mock: ^2.9.6 vite-plugin-style-import: ^1.2.1 vite-svg-loader: ^2.2.0 @@ -97,7 +97,7 @@ dependencies: mockjs: 1.1.0 nprogress: 0.2.0 path: 0.12.7 - pinia: 2.0.2_typescript@4.4.2+vue@3.2.24 + pinia: 2.0.9_typescript@4.4.2+vue@3.2.24 qs: 6.10.2 remixicon: 2.5.0 resize-observer-polyfill: 1.5.1 @@ -126,7 +126,6 @@ devDependencies: "@vue/eslint-config-typescript": 7.0.0_e03d82996bd4a66fb128f33523d782ea "@zougt/vite-plugin-theme-preprocessor": 1.4.0_sass@1.45.0 autoprefixer: 10.2.4_postcss@8.2.6 - babel-plugin-transform-remove-console: 6.9.4 cross-env: 7.0.3 eslint: 7.30.0 eslint-plugin-prettier: 3.4.0_eslint@7.30.0+prettier@2.3.2 @@ -147,6 +146,7 @@ devDependencies: typescript: 4.4.2 unplugin-element-plus: 0.1.3_vite@2.6.14+vue@3.2.24 vite: 2.6.14_sass@1.45.0 + vite-plugin-full-reload: 1.0.0 vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@2.6.14 vite-plugin-style-import: 1.3.0_vite@2.6.14 vite-svg-loader: 2.2.0 @@ -1397,6 +1397,13 @@ packages: } dev: false + /@vue/devtools-api/6.0.0-beta.21.1: + resolution: + { + integrity: sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw== + } + dev: false + /@vue/eslint-config-prettier/6.0.0_82e4252401b0cc5be86f7c2133946f49: resolution: { @@ -1870,10 +1877,6 @@ packages: - debug dev: false - /babel-plugin-transform-remove-console/6.9.4: - resolution: { integrity: sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= } - dev: true - /bail/1.0.5: resolution: { @@ -5168,19 +5171,27 @@ packages: engines: { node: ">=8.6" } dev: true + /picomatch/2.3.1: + resolution: + { + integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + } + engines: { node: ">=8.6" } + dev: true + /pify/2.3.0: resolution: { integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= } engines: { node: ">=0.10.0" } dev: true - /pinia/2.0.2_typescript@4.4.2+vue@3.2.24: + /pinia/2.0.9_typescript@4.4.2+vue@3.2.24: resolution: { - integrity: sha512-ljN+9p9XHE8YrMBgxLbpo5rdVPj7Fri4Bl9qswz5dJPeoK6ra66YOLrGpBoCsHjAqu9jOBC3oJeErocicf51oA== + integrity: sha512-iuYdxLJKQ07YPyOHYH05wNG9eKWqkP/4y4GE8+RqEYtz5fwHgPA5kr6zQbg/DoEJGnR2XCm1w1vdt6ppzL9ATg== } peerDependencies: - "@vue/composition-api": ^1.3.0 - typescript: ^4.4.4 + "@vue/composition-api": ^1.4.0 + typescript: ">=4.4.4" vue: ^2.6.14 || ^3.2.0 peerDependenciesMeta: "@vue/composition-api": @@ -5188,7 +5199,7 @@ packages: typescript: optional: true dependencies: - "@vue/devtools-api": 6.0.0-beta.20 + "@vue/devtools-api": 6.0.0-beta.21.1 typescript: 4.4.2 vue: 3.2.24 vue-demi: 0.12.1_vue@3.2.24 @@ -7062,6 +7073,16 @@ packages: vfile-message: 2.0.4 dev: true + /vite-plugin-full-reload/1.0.0: + resolution: + { + integrity: sha512-GUhQ4wSm+H6yAlz7d2JwLu+BEcsFqZu1SUH0CNG+uyP4ALXGofUjHi+eGdLX19bYhMuOUWW3EwMt68jFkBsMew== + } + dependencies: + picocolors: 1.0.0 + picomatch: 2.3.1 + dev: true + /vite-plugin-mock/2.9.6_mockjs@1.1.0+vite@2.6.14: resolution: { diff --git a/src/layout/components/navbar.vue b/src/layout/components/navbar.vue index fbd74f1..b3228b3 100644 --- a/src/layout/components/navbar.vue +++ b/src/layout/components/navbar.vue @@ -14,6 +14,7 @@ import { unref, watch, getCurrentInstance } from "vue"; import { deviceDetection } from "/@/utils/deviceDetection"; import screenfull from "../components/screenfull/index.vue"; import globalization from "/@/assets/svg/globalization.svg"; +import { useEpThemeStoreHook } from "/@/store/modules/epTheme"; const instance = getCurrentInstance().appContext.config.globalProperties.$storage; @@ -26,7 +27,7 @@ const { locale } = useI18n(); const getDropdownItemStyle = computed(() => { return t => { return { - background: locale.value === t ? "#1b2a47" : "", + background: locale.value === t ? useEpThemeStoreHook().epThemeColor : "", color: locale.value === t ? "#f4f4f5" : "#000" }; }; @@ -149,10 +150,6 @@ function translationEn() { cursor: pointer; transition: background 0.3s; -webkit-tap-highlight-color: transparent; - - &:hover { - background: rgba(0, 0, 0, 0.025); - } } .vertical-header-right { diff --git a/src/layout/components/setting/index.vue b/src/layout/components/setting/index.vue index 7721450..a4185a5 100644 --- a/src/layout/components/setting/index.vue +++ b/src/layout/components/setting/index.vue @@ -444,7 +444,7 @@ nextTick(() => { diff --git a/src/layout/components/sidebar/hamBurger.vue b/src/layout/components/sidebar/hamBurger.vue index e14b31d..8746991 100644 --- a/src/layout/components/sidebar/hamBurger.vue +++ b/src/layout/components/sidebar/hamBurger.vue @@ -1,4 +1,6 @@