@peng_kai/kit 0.3.0-beta.2 → 0.3.0-beta.4
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.
package/admin/styles/index.scss
CHANGED
|
@@ -72,14 +72,15 @@ export function useAntdModal<Comp extends Component>(
|
|
|
72
72
|
newCompProps?: typeof compProps,
|
|
73
73
|
newAntdModalProps?: Omit<Partial<ModalProps>, 'open'>,
|
|
74
74
|
) => {
|
|
75
|
-
Object.assign(_modalProps, newAntdModalProps);
|
|
76
|
-
Object.assign(compProps, newCompProps);
|
|
77
|
-
|
|
78
75
|
if (_modalProps.open) {
|
|
79
76
|
// return Promise.reject(new Error('Modal is already open'));
|
|
80
77
|
return;
|
|
81
78
|
}
|
|
82
79
|
|
|
80
|
+
Object.assign(_modalProps, newAntdModalProps);
|
|
81
|
+
Object.keys(compProps).forEach(key => delete compProps[key]);
|
|
82
|
+
Object.assign(compProps, newCompProps);
|
|
83
|
+
|
|
83
84
|
promiseResolvers = Promise.withResolvers();
|
|
84
85
|
_modalProps.open = true;
|
|
85
86
|
|
|
@@ -95,11 +96,11 @@ export function useAntdModal<Comp extends Component>(
|
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
const PresetComponent = defineComponent({
|
|
98
|
-
setup() {
|
|
99
|
+
setup(props) {
|
|
99
100
|
onMounted(() => _modalProps.opener?.(open as any));
|
|
100
101
|
|
|
101
102
|
return () => {
|
|
102
|
-
return createVNode(AntModal, _modalProps, {
|
|
103
|
+
return createVNode(AntModal, { ..._modalProps, ...props }, {
|
|
103
104
|
[modalSlotName]: () => createVNode(_comp.is, compProps as any),
|
|
104
105
|
});
|
|
105
106
|
};
|