新项目, antd6, react19
This commit is contained in:
26
src/pages/User/List/components/UserEditModal.tsx
Normal file
26
src/pages/User/List/components/UserEditModal.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import type React from 'react';
|
||||
import { useImperativeHandle, useState } from 'react';
|
||||
import ModalPlugin from '@/components/ModalPlugin';
|
||||
import type { IRef } from '@/utils/type';
|
||||
|
||||
interface IProps extends IRef {}
|
||||
|
||||
export type IUserEditModalType = {
|
||||
show: () => void;
|
||||
};
|
||||
|
||||
export const UserEditModal: React.FC<IProps> = (props) => {
|
||||
console.log(props.ref);
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useImperativeHandle(props.ref, () => ({
|
||||
show: () => {
|
||||
setOpen(true);
|
||||
},
|
||||
}));
|
||||
return (
|
||||
<ModalPlugin open={open} onCancel={() => setOpen(false)}>
|
||||
11111
|
||||
</ModalPlugin>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user