我正在执行材料表,但是要添加一个动作,该列如下所示:
在所附图片中,列操作看起来不正确,看起来很堆叠
这是表格的代码:
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);
这是什么意思?如何纠正?