Material-ui自定义表格与按钮重叠

时间:2019-05-29 12:46:52

标签: reactjs material-ui

我正在尝试渲染material-ui custom table,但是每次它在我的浏览器中渲染或我更改页面按钮时,它们就会重叠image2 但是,如果我缩小浏览器按钮,则工作正常。 enter image description here

由于我不想缩小浏览器,但是我希望它在所有刺激下都能正常工作,这可能是原因吗? 我附上了呈现我的桌子的代码。

表格样式(直接从material-ui网站获取):

const useStyles1 = makeStyles(theme => ({
    root: {
      flexShrink: 0,
      color: theme.palette.text.secondary,
      marginLeft: theme.spacing(2.5)
    }
  }));

我的表格页脚渲染方法:

return (
    <Container>
      <div className={classes.root}>
        <IconButton
          onClick={handleFirstPageButtonClick}
          disabled={page === 0}
          aria-label="First Page"
        >
          {theme.direction === "rtl" ? <LastPageIcon /> : <FirstPageIcon />}
        </IconButton>
        <IconButton
          onClick={handleBackButtonClick}
          disabled={page === 0}
          aria-label="Previous Page"
        >
          {theme.direction === "rtl" ? (
            <KeyboardArrowRight />
          ) : (
            <KeyboardArrowLeft />
          )}
        </IconButton>
        <IconButton
          onClick={handleNextButtonClick}
          disabled={page >= Math.ceil(count / rowsPerPage) - 1}
          aria-label="Next Page"
        >
          {theme.direction === "rtl" ? (
            <KeyboardArrowLeft />
          ) : (
            <KeyboardArrowRight />
          )}
        </IconButton>
        <IconButton
          onClick={handleLastPageButtonClick}
          disabled={page >= Math.ceil(count / rowsPerPage) - 1}
          aria-label="Last Page"
        >
          {theme.direction === "rtl" ? <FirstPageIcon /> : <LastPageIcon />}
        </IconButton>
      </div>
    </Container>
  );

0 个答案:

没有答案