From d235ea2857835da76f82d7f6b2003b9c7342a259 Mon Sep 17 00:00:00 2001 From: liect Date: Tue, 17 Dec 2024 18:55:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=94=B9=E4=B8=BAVue3.5=E8=A7=A3?= =?UTF-8?q?=E6=9E=84=E8=AF=AD=E6=B3=95=20(#799)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/color/index.vue | 3 +-- src/components/result/index.vue | 4 ++-- src/components/thumbnail/index.vue | 3 +-- src/components/trend/index.vue | 3 +-- src/layouts/components/Header.vue | 5 ++--- src/layouts/components/MenuContent.vue | 3 +-- src/layouts/components/SideNav.vue | 5 +---- src/pages/list/card/components/DialogForm.vue | 6 +++--- 8 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/components/color/index.vue b/src/components/color/index.vue index f62207a..3633e80 100644 --- a/src/components/color/index.vue +++ b/src/components/color/index.vue @@ -9,14 +9,13 @@ import { DEFAULT_COLOR_OPTIONS } from '@/config/color'; const panelColor = 'conic-gradient(from 90deg at 50% 50%, #FF0000 -19.41deg, #FF0000 18.76deg, #FF8A00 59.32deg, #FFE600 99.87deg, #14FF00 141.65deg, #00A3FF 177.72deg, #0500FF 220.23deg, #AD00FF 260.13deg, #FF00C7 300.69deg, #FF0000 340.59deg, #FF0000 378.76deg)'; -const props = defineProps({ +const { value } = defineProps({ value: { type: String, }, }); const style = computed(() => { - const { value } = props; return { background: DEFAULT_COLOR_OPTIONS.indexOf(value) > -1 ? value : panelColor, }; diff --git a/src/components/result/index.vue b/src/components/result/index.vue index 74045b8..f0848aa 100644 --- a/src/components/result/index.vue +++ b/src/components/result/index.vue @@ -18,7 +18,7 @@ import ResultIeIcon from '@/assets/assets-result-ie.svg?component'; import ResultMaintenanceIcon from '@/assets/assets-result-maintenance.svg?component'; import ResultWifiIcon from '@/assets/assets-result-wifi.svg?component'; -const props = defineProps({ +const { type } = defineProps({ bgUrl: String, title: String, tip: String, @@ -26,7 +26,7 @@ const props = defineProps({ }); const dynamicComponent = computed(() => { - switch (props.type) { + switch (type) { case '403': return Result403Icon; case '404': diff --git a/src/components/thumbnail/index.vue b/src/components/thumbnail/index.vue index 370774d..fcb8c98 100644 --- a/src/components/thumbnail/index.vue +++ b/src/components/thumbnail/index.vue @@ -4,7 +4,7 @@