diff --git a/console/packages/components/src/components/dialog/Dialog.vue b/console/packages/components/src/components/dialog/Dialog.vue index 6494e15a2..247bec2c9 100644 --- a/console/packages/components/src/components/dialog/Dialog.vue +++ b/console/packages/components/src/components/dialog/Dialog.vue @@ -8,7 +8,7 @@ import { IconForbidLine, IconInformation, } from "../../icons/icons"; -import { computed, ref } from "vue"; +import { ref, type Component, markRaw, type Raw } from "vue"; import type { Type } from "@/components/dialog/interface"; import type { Type as ButtonType } from "@/components/button/interface"; @@ -48,25 +48,24 @@ const emit = defineEmits<{ (event: "close"): void; }>(); -const icons = { +const icons: Record; color: string }> = { success: { - icon: IconCheckboxCircle, + icon: markRaw(IconCheckboxCircle), color: "green", }, info: { - icon: IconInformation, + icon: markRaw(IconInformation), color: "blue", }, warning: { - icon: IconErrorWarning, + icon: markRaw(IconErrorWarning), color: "orange", }, error: { - icon: IconForbidLine, + icon: markRaw(IconForbidLine), color: "red", }, }; -const icon = computed(() => icons[props.type]); const loading = ref(false); @@ -108,8 +107,8 @@ const handleClose = () => {
{{ title }}
diff --git a/console/packages/components/src/components/toast/Toast.vue b/console/packages/components/src/components/toast/Toast.vue index cefc9ab81..8b5b49564 100644 --- a/console/packages/components/src/components/toast/Toast.vue +++ b/console/packages/components/src/components/toast/Toast.vue @@ -1,6 +1,13 @@