物料表的动作列看起来不正确

时间:2019-11-16 17:00:53

标签: reactjs material-ui

我正在执行材料表,但是要添加一个动作,该列如下所示:

table

在所附图片中,列操作看起来不正确,看起来很堆叠

这是表格的代码:

import React from 'react';
import MaterialTable from 'material-table';
import { connect } from 'react-redux';
import { eliminarPropiedad, eliminarObjetoPropiedad, actualizarPropiedad,eliminarPropiedadAlert } from 'enl-redux/actions/reduxFormActions';
import { bindActionCreators } from 'redux';
import { myIndexOf } from '../aux.js';


function MaterialTableDemo(props) {
  const [state, setState] = React.useState({
  });

  return (
    <MaterialTable
      title={props.nombre}
      columns={props.columns}
      data={props.data}
      actions={[
        {
          icon: 'backup',
          tooltip: 'backup',
          onClick: (event, rowData) => {
            // Do save operation
          }
        }
      ]}

    />
  );
}

const mapStateToProps = (state) => ({
  state: state.get('initval')
});
const mapDispatchToProps = dispatch => ({
  handleEliminar: bindActionCreators(eliminarPropiedad, dispatch),
  handleModal: bindActionCreators(eliminarPropiedadAlert, dispatch),
  handleActualizar: bindActionCreators(actualizarPropiedad, dispatch),
  handleEliminarObj: bindActionCreators(eliminarObjetoPropiedad, dispatch),
  // decrement: () => dispatch({ type: 'ELIMINAR_OBJETO' }),
});
export default connect(mapStateToProps, mapDispatchToProps)(MaterialTableDemo);

这是什么意思?如何纠正?

0 个答案:

没有答案