在 Ant Design v4 中,Card 组件的样式 boxShadow 可以通过使用 CSS 的 box-shadow 属性来设置。以下是一个示例代码:
import React from 'react';
import { Card } from 'antd';
const App = () => {
return (
Card content
Card content
Card content
);
};
export default App;
在上面的示例代码中,我们通过在 Card 组件的 style 属性中设置 boxShadow 属性来实现阴影效果。boxShadow 属性接受四个参数,分别是水平偏移量、垂直偏移量、模糊半径和扩散半径。最后一个参数表示阴影的颜色和透明度。
注意,我们使用的是内联样式来设置 boxShadow 属性。你也可以将样式定义为一个对象,然后在 Card 组件的 style 属性中引用该对象。
希望这个示例能够帮助到你!