@peng_kai/kit 0.2.45 → 0.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,21 +63,23 @@ export function useAntdModal<Comp extends Component>(
|
|
|
63
63
|
|
|
64
64
|
const _onClose = (e?: any) => {
|
|
65
65
|
if (_modalProps.rejectOnClose)
|
|
66
|
-
promiseResolvers
|
|
66
|
+
promiseResolvers?.reject(e ?? new Error('Modal Cancel'));
|
|
67
67
|
else
|
|
68
|
-
promiseResolvers
|
|
68
|
+
promiseResolvers?.resolve(undefined as any);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
const open = (
|
|
72
72
|
newCompProps?: typeof compProps,
|
|
73
73
|
newAntdModalProps?: Omit<Partial<ModalProps>, 'open'>,
|
|
74
74
|
) => {
|
|
75
|
-
if (_modalProps.open)
|
|
76
|
-
return Promise.reject(new Error('Modal is already open'));
|
|
77
|
-
|
|
78
75
|
Object.assign(_modalProps, newAntdModalProps);
|
|
79
76
|
Object.assign(compProps, newCompProps);
|
|
80
77
|
|
|
78
|
+
if (_modalProps.open) {
|
|
79
|
+
// return Promise.reject(new Error('Modal is already open'));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
81
83
|
promiseResolvers = Promise.withResolvers();
|
|
82
84
|
_modalProps.open = true;
|
|
83
85
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { computed, nextTick, onActivated, onDeactivated, onMounted, ref } from '
|
|
|
5
5
|
*/
|
|
6
6
|
export function useIsActivated() {
|
|
7
7
|
const isMounted = ref(false);
|
|
8
|
-
const isActivated = ref(
|
|
8
|
+
const isActivated = ref(true);
|
|
9
9
|
|
|
10
10
|
onMounted(() => setTimeout(() => isMounted.value = true));
|
|
11
11
|
onActivated(() => nextTick(() => isActivated.value = true));
|