From 4891f49b7d861bde918bfc6e996a6b8cdfa6717a Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Wed, 31 Jan 2024 14:23:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/components/Form/src/Form.vue | 12 ++++++++++-- src/components/TabMenu/src/TabMenu.vue | 3 +++ uno.config.ts | 16 +++++++++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 2deeca0..a35d9d7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build:pro": "pnpm vite build --mode pro", "build:gitee": "pnpm vite build --mode gitee", "build:dev": "pnpm vite build --mode dev", - "build:test": "pnpm run ts:check && vite build --mode test", + "build:test": "pnpm vite build --mode test", "serve:pro": "pnpm vite preview --mode pro", "serve:dev": "pnpm vite preview --mode dev", "serve:test": "pnpm vite preview --mode test", @@ -40,7 +40,7 @@ "driver.js": "^1.3.1", "echarts": "^5.4.3", "echarts-wordcloud": "^2.1.0", - "element-plus": "^2.4.4", + "element-plus": "2.5.3", "lodash-es": "^4.17.21", "mitt": "^3.0.1", "nprogress": "^0.2.0", diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index 9cf2c5b..c31baa1 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -406,7 +406,15 @@ export default defineComponent({ margin-left: 0 !important; } -.@{elNamespace}-form--inline .@{elNamespace}-input { - width: 245px; +.@{elNamespace}-form--inline { + :deep(.el-form-item__content) { + & > :first-child { + min-width: 229.5px; + } + } + .@{elNamespace}-input-number { + // 229.5px是兼容el-input-number的最小宽度, + min-width: 229.5px; + } } diff --git a/src/components/TabMenu/src/TabMenu.vue b/src/components/TabMenu/src/TabMenu.vue index 8fcb54d..4b12a46 100644 --- a/src/components/TabMenu/src/TabMenu.vue +++ b/src/components/TabMenu/src/TabMenu.vue @@ -85,6 +85,9 @@ export default defineComponent({ } else { showTitle.value = !collapse } + }, + { + immediate: true } ) diff --git a/uno.config.ts b/uno.config.ts index 5119e5b..2de20ab 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -1,16 +1,26 @@ import { defineConfig, toEscapedSelector as e, presetUno, presetIcons } from 'unocss' import transformerVariantGroup from '@unocss/transformer-variant-group' +import { loadEnv } from 'vite' + +const root = process.cwd() const createPresetIcons = () => { + const isBuild = !!process.argv[4] + let env = {} as any + if (!isBuild) { + env = loadEnv(process.argv[4], root) + } else { + env = loadEnv(process.argv[3], root) + } // @ts-ignore - if (import.meta.env.VITE_USE_ONLINE_ICON === 'true') { + if (env.VITE_USE_ONLINE_ICON === 'true') { + return [] + } else { return [ presetIcons({ prefix: '' }) ] - } else { - return [] } }