如何更改材料表的默认图标?我不想使用材料表包中描述的材料图标包。有想法吗?
我想使用'zmdi'字体代替默认图标。这就是我已经想知道自己在做什么对吗?
谢谢。
const tableIcons: Icons = {
Search: forwardRef((props, ref) => <span className="zmdi zmdi-search"/>),
Clear: forwardRef((props, ref) => <span className="zmdi zmdi-search"/>)
};
<MaterialTable
icons={tableIcons}
/>
答案 0 :(得分:0)
const tableIcons: Icons = {
Search: forwardRef((props, ref) => <span className="zmdi zmdi-search" />),
Clear: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-close" />
</div>
)),
SortArrow: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-long-arrow-up" />
</div>
)),
FirstPage: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-caret-left" />
</div>
)),
NextPage: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-chevron-right" />
</div>
)),
PreviousPage: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-chevron-left" />
</div>
)),
LastPage: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-caret-right" />
</div>
)),
ResetSearch: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-close" />
</div>
)),
ThirdStateCheck: forwardRef((props, ref) => (
<div {...props} ref={ref}>
<span className="zmdi zmdi-close" />
</div>
))
};
我设法做到了这一点。