不使用默认搜索栏,我想将其自定义如下:
- 在搜索栏前面添加一个按钮。
<i className="fa fa-search"/>
在搜索占位符中使用图标 ( )。
到目前为止,这是我的代码:
import { Grid, _ } from 'gridjs-react';
const tableColumns = [
'Name',
'Phone',
{
name: 'Custom component',
formatter: (text) => _(<b>{text}</b>)
}
]
const tableData = [
['John', 12345, 'myText1'],
['Mike', 67891, 'myText2'],
]
export default function myCustomGrid() {
return (
<Grid
sort={true}
search={true} // This adds the search inp
columns={tableColumns}
data={tableData}
language={{
search: {
placeholder: ' Search...'
}
}}
pagination={{
enabled: true,
limit: 2
}}
/>
);
}