From f6884ba4f96ae63ae1365c037c009792a66542a6 Mon Sep 17 00:00:00 2001 From: Allen Date: Wed, 15 May 2024 10:27:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=8D=B8=E8=BD=BD=E6=97=B6=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=88=B7=E6=96=B0=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/misc/DashboardElement.vue | 9 +++++++++ src/pages/dashboard.vue | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/misc/DashboardElement.vue b/src/components/misc/DashboardElement.vue index 4ecf2347..b438f006 100644 --- a/src/components/misc/DashboardElement.vue +++ b/src/components/misc/DashboardElement.vue @@ -16,6 +16,15 @@ import { isNullOrEmptyObject } from '@/@core/utils' const props = defineProps({ // 仪表板配置 config: Object as PropType, + // 刷新状态 + refreshStatus: Boolean, +}) + +const emit = defineEmits(['update:refreshStatus']) + +onUnmounted(() => { + // 组件卸载时禁用刷新状态 + emit('update:refreshStatus', false) }) - {{ props.config?.name }} + {{ props.config?.name + (props.config?.attrs?.subtitle ? ' - ' + props.config.attrs.subtitle : '') }} diff --git a/src/pages/dashboard.vue b/src/pages/dashboard.vue index 2ef5a744..d2591fa5 100644 --- a/src/pages/dashboard.vue +++ b/src/pages/dashboard.vue @@ -268,7 +268,10 @@ onBeforeMount(async () => { - +