【发布时间】:2021-02-08 21:18:37
【问题描述】:
我正在使用 ant design Button 并设置图标,但图标未显示在按钮的中心。
import "antd/dist/antd.css";
import { DeleteOutlined } from "@ant-design/icons";
<Row>
<Col span={2} style={{ padding: "5px" }} >
<Button
type="primary"
size="middle"
shape="circle"
danger
icon={<DeleteOutlined />}
onClick={() => deleteSkid(index)}
/>
</Col>
</Row>
我也尝试过这样,但没有任何变化。
<Row>
<Col span={2} style={{ padding: "5px" }} >
<Button
type="primary"
size="middle"
shape="circle"
danger
onClick={() => deleteSkid(index)}
>
<DeleteOutlined />
</Button>
</Col>
</Row>
【问题讨论】:
-
你能告诉我们DeleteOutlined元素吗?也许我们可以自定义那个 css。尝试向我们展示 html 结构
-
我已经用 import { DeleteOutlined } from "@ant-design/icons" 更新了我的问题;
-
它适用于我。似乎您可能有一些导致问题的 CSS,或者可能安装的版本可能有错误。
标签: javascript reactjs styles stylesheet antd