feat: 登录日志(demo)
This commit is contained in:
@@ -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;
|
||||
|
@@ -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));
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user