fix(ui): 重构 AddTransactionDialog 嵌套层级,解决 DialogTrigger 上下文丢失报错
This commit is contained in:
parent
574d27968d
commit
ffeac757e3
@ -146,7 +146,7 @@ export function AddTransactionDialog({ assets, open: openProp, onOpenChange, def
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
{!openProp && (
|
{!openProp && (
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button>
|
<Button>
|
||||||
@ -155,7 +155,6 @@ export function AddTransactionDialog({ assets, open: openProp, onOpenChange, def
|
|||||||
</Button>
|
</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
)}
|
)}
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
|
||||||
<DialogContent className="sm:max-w-[500px]">
|
<DialogContent className="sm:max-w-[500px]">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>添加交易流水</DialogTitle>
|
<DialogTitle>添加交易流水</DialogTitle>
|
||||||
@ -343,6 +342,5 @@ export function AddTransactionDialog({ assets, open: openProp, onOpenChange, def
|
|||||||
</Form>
|
</Form>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user