xiaochan 1 년 전
부모
커밋
c90a7c8f40
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 2
      src/components/xiao-chan/cy-message-box/cy-message-box.ts
  2. 2 1
      src/components/xiao-chan/cy-message-box/index.vue

+ 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"/>