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>
 <script lang="ts">
   import type { ModalProps, ModalMethods } from './typing';
-
+  import { debounce } from 'lodash-es';
   import {
     defineComponent,
     computed,
@@ -202,10 +202,13 @@
           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) {
         emit('height-change', height);