如何在 React material table 的列中添加自定义复选框?

How to add custom checkbox in column in react material table?

您好,我在 React 项目中使用 material table。我想在我的 table 单元格中添加一个复选框。 例如在出生年份列中用 1987 代替。如何实现?

https://codesandbox.io/s/material-demo-forked-5h51b?file=/demo.js:701-911

<MaterialTable
      title="Editable Example"
      columns={state.columns}
      data={state.data}
      options={{
        selection: true
      }}
      editable={{
       //Edit Code here
      }}
    />

我找到了答案...在列中只需添加类型:'boolean'。 例如,

    {
      title: "Unit",
      field: "unit",
      type: 'boolean',
      
    },