xiaochan 1 年之前
父節點
當前提交
c90a7c8f40

+ 3 - 2
src/components/xiao-chan/cy-message-box/cy-message-box.ts

@@ -29,7 +29,7 @@ export function getCyId(): string {
     return 'cy-' + uuid(5)
 }
 
-export function closeById(id: string) {
+function closeById(id: string) {
     if (currentBox.has(id))
         currentBox.get(id)?.['close']()
 }
@@ -108,6 +108,7 @@ function renderFunc(message: string, type: 'success' | 'error' | 'warning' | 'in
 export const cyMessageBox = {
     alert,
     confirm,
-    prompt
+    prompt,
+    closeById
 }
 

+ 2 - 1
src/components/xiao-chan/cy-message-box/index.vue

@@ -188,7 +188,8 @@ function close() {
           </ElIcon>
         </div>
         <header ref="headerRef">
-          <el-icon :class="['cy-' + props.type]" class="cy-message_header-icon">
+          <el-icon :class="['cy-' + props.type]"
+                   class="cy-message_header-icon">
             <component :is="headerIcon"/>
           </el-icon>
           <Component :is="titleRender"/>