From 2f3428d291d7c6ff211a36338e597ec92a8e8482 Mon Sep 17 00:00:00 2001 From: Zirui Cai <74649535+Feudalman@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:40:21 +0800 Subject: [PATCH] feat: message style and warning type (#144) --- vue/src/components/message/SLMessage.vue | 83 ++++++++++++++++++++++-- vue/src/components/message/index.js | 9 +++ 2 files changed, 87 insertions(+), 5 deletions(-) diff --git a/vue/src/components/message/SLMessage.vue b/vue/src/components/message/SLMessage.vue index 9b7964d8f..f8947524e 100644 --- a/vue/src/components/message/SLMessage.vue +++ b/vue/src/components/message/SLMessage.vue @@ -1,8 +1,69 @@ @@ -35,4 +96,16 @@ onUnmounted(() => { }) - + diff --git a/vue/src/components/message/index.js b/vue/src/components/message/index.js index 94dcece60..6978cd6e4 100644 --- a/vue/src/components/message/index.js +++ b/vue/src/components/message/index.js @@ -26,6 +26,15 @@ export const message = { success: (text, delay, onClose) => { message._ref.add(text, 'success', delay, onClose) }, + /** + * @description 显示警告消息 + * @param {String} text 消息文本 + * @param {Number} delay 延迟关闭时间 + * @param {Function} onClose 关闭时的回调函数 + */ + warning: (text, delay, onClose) => { + message._ref.add(text, 'warning', delay, onClose) + }, /** * 清空所有消息 */