tangning 1 天之前
父节点
当前提交
69a653db26
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      src/components/Modal/src/BasicModal.vue

+ 8 - 5
src/components/Modal/src/BasicModal.vue

@@ -50,7 +50,7 @@
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
   import type { ModalProps, ModalMethods } from './typing';
   import type { ModalProps, ModalMethods } from './typing';
-
+  import { debounce } from 'lodash-es';
   import {
   import {
     defineComponent,
     defineComponent,
     computed,
     computed,
@@ -202,10 +202,13 @@
           fullScreenRef.value = !!props.defaultFullscreen;
           fullScreenRef.value = !!props.defaultFullscreen;
         }
         }
       }
       }
-
-      function handleOk(e: Event) {
-        emit('ok', e);
-      }
+      const handleOk = debounce(
+        (e: Event) => {
+          emit('ok', e);
+        },
+        200,
+        { leading: true, trailing: false },
+      );
 
 
       function handleHeightChange(height: string) {
       function handleHeightChange(height: string) {
         emit('height-change', height);
         emit('height-change', height);