feat: 登录日志(demo)

This commit is contained in:
dap
2024-09-12 09:51:59 +08:00
parent 3987c9e876
commit 45ed89c25f
8 changed files with 314 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ export interface DescriptionProps extends DescriptionsProps {
}
export interface DescInstance {
setDescProps(descProps: Partial<DescriptionProps>): void;
setDescProps(descProps: Partial<DescriptionProps>, delay?: boolean): void;
}
export type Register = (descInstance: DescInstance) => void;

View File

@@ -27,8 +27,16 @@ export function useDescription(
}
const methods: DescInstance = {
setDescProps: (descProps: Partial<DescriptionProps>): void => {
unref(desc)?.setDescProps(descProps);
setDescProps: (
descProps: Partial<DescriptionProps>,
delay = false,
): void => {
if (!delay) {
unref(desc)?.setDescProps(descProps);
return;
}
// 奇怪的问题 在modal中需要setTimeout才会生效
setTimeout(() => unref(desc)?.setDescProps(descProps));
},
};