From 9a3f1f82a40b145816a7abc605b881b7097016d6 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 17 Dec 2024 19:24:22 +0800 Subject: [PATCH] * modal: change message type to custom content type. --- lib/modal/src/types/modal-options.ts | 2 +- lib/modal/src/vanilla/modal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modal/src/types/modal-options.ts b/lib/modal/src/types/modal-options.ts index 37d2093a23..29e80026ad 100644 --- a/lib/modal/src/types/modal-options.ts +++ b/lib/modal/src/types/modal-options.ts @@ -43,7 +43,7 @@ export interface ModalIframeOptions extends ModalOptions { } export interface ModalAlertOptions extends ModalCustomOptions { - message: string | {html: string}; + message: CustomContentType; icon?: string; iconClass?: string; actions?: ToolbarItemOptions[] | string | string[]; diff --git a/lib/modal/src/vanilla/modal.tsx b/lib/modal/src/vanilla/modal.tsx index 976ece6bbb..2a27dad63f 100644 --- a/lib/modal/src/vanilla/modal.tsx +++ b/lib/modal/src/vanilla/modal.tsx @@ -296,7 +296,7 @@ export class Modal extends ModalBase { } const {type, message, icon, iconClass = 'icon-lg muted', actions = 'confirm', onClickAction, custom, key = '__alert', ...otherOptions} = options; const customOptions = (typeof custom === 'function' ? custom() : custom) || {}; - let content = typeof message === 'object' && message.html ?
: (
{message}
); + let content = ; if (icon) { content = (