xiaochan 5 ماه پیش
والد
کامیت
78a1b17584
2فایلهای تغییر یافته به همراه3 افزوده شده و 8 حذف شده
  1. 2 7
      src/components/cy/CyDialog/index.ts
  2. 1 1
      src/components/cy/CyDialog/index.vue

+ 2 - 7
src/components/cy/CyDialog/index.ts

@@ -30,13 +30,6 @@ export namespace UseDialogType {
   }
 }
 
-type FirstParam<T> =
-  T extends Component<infer P, any, any, any, any, any>
-    ? P extends Record<string, any>
-      ? P
-      : {}
-    : never;
-
 export interface DialogOptions<P extends Component> {
   dialogProps?: DialogProps;
   params?: ExtractPropTypes<P>;
@@ -91,9 +84,11 @@ export function useDialog<C extends Component>(
     const pushIndex = dialogStore.value.push({
       ...props,
       resolve: XEUtils.once(value => {
+        props.visible = false;
         resolve(value);
       }),
       reject: XEUtils.once(value => {
+        props.visible = false;
         props.ignoreError ? resolve(value) : reject(value);
       }),
       dialogKey: dialogKey.value,

+ 1 - 1
src/components/cy/CyDialog/index.vue

@@ -72,7 +72,7 @@ const getClass = (item: DialogState) => {
 };
 
 const style = (item: DialogState) => {
-  if (item.dialogProps.fullscreen) {
+  if (item?.dialogProps?.fullscreen) {
     return {};
   }
   return {