在按钮中添加 SVG 图像作为图标 (react-bootstrap)?
Add a SVG image as an icon in Button (react-bootstrap)?
我想要得到如下图所示的结果。我正在使用 react-bootstrap
中的 Button
。
<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
Abonnement Premium
</Button>
如何在 React 中将 SVG
图像作为图标添加到按钮?
导入图片
import yourImg from '../to/your/image.svg';
在
字前加上即可
<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
<img src={yourImg} /> Abonnement Premium
</Button>
我想要得到如下图所示的结果。我正在使用 react-bootstrap
中的 Button
。
<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
Abonnement Premium
</Button>
如何在 React 中将 SVG
图像作为图标添加到按钮?
导入图片
import yourImg from '../to/your/image.svg';
在
字前加上即可<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
<img src={yourImg} /> Abonnement Premium
</Button>