当我点击按钮时,会出现这个组件。我想知道是否有一种简单的缓动效果来展开或弹出动画。让它在转换过程中看起来更加顺畅,而不是突然出现?
const CardExample = () => {
const [show, setShow] = useState(false);
const handleClick = () => {
setShow(!show);
};
return (
<div>
<Button onClick={handleClick} type="primary">
Show Card
</Button>
<Card style={{ display: show && "none" }}>This is my card</Card>
</div>
);
};