# 如何用自定义图标替换现有SVG图标？

**URL:** <https://meta.discourse.org/t/how-to-replace-an-existing-svg-icon-with-a-custom-one/277743>\
**Category:** Development\
**Created:** [2021 年3 月 14 日 17:18 UTC](https://meta.discourse.org/t/how-to-replace-an-existing-svg-icon-with-a-custom-one/277743 "2021-03-14T17:18:47Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

作者： ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
发布日期： [2021 年3 月 23 日 19:57 UTC](https://meta.discourse.org/t/how-to-replace-an-existing-svg-icon-with-a-custom-one/277743/10 "2021-03-23T19:57:11Z")

</div>

好的，试试使用这个：[Dropbox](https://www.dropbox.com/s/zong5a7rmjf333w/discourse-custom-icons.zip?dl=0)

我只为 `d-liked` 添加了 `replaceIcon` 调用，你需要在实例中编辑组件并添加其他行。请确保使用 SVG 文件中的 ID，现在它们只是 `SVGpig` 和 `SVGpigout`。

---

_[View the full topic](https://meta.discourse.org/t/how-to-replace-an-existing-svg-icon-with-a-custom-one/277743)._
