【发布时间】:2021-10-29 04:54:10
【问题描述】:
有没有办法用自定义图标(如 React Icons 中的图标)替换内联工具栏图像?
代码(工具栏选项):
import { AiOutlineUnorderedList } from 'react-icons/ai'
export const toolbarOptions = {
options: ['list', 'link'],
list: {
options: ['unordered', 'ordered'],
unordered: {
icon: <AiOutlineUnorderedList />, //does not work
className: undefined,
},
},
link: {
options: ['link'],
},
}
我也尝试过使用<img src="./path-to-svg"/>,但是效果不佳...
有什么想法吗?
TIA
【问题讨论】:
标签: reactjs draftjs react-draft-wysiwyg