【问题标题】:React material-table/core Localization for selected Rows not working选定行的反应材料表/核心本地化不起作用
【发布时间】:2022-11-15 02:41:57
【问题描述】:

我有一张如下表,我使用的是@material-table/core: 0.2.52 版本

<MaterialTable
      isLoading={loading}
      title=""
      columns={[
        {title: 'Track', field: 'track'},
        {title: 'Tier', field: 'tier'},
        {title: 'Architecture', field: 'architecture'},
        {title: 'Archtier', field: 'archtier'},
        {title: 'Lifecycle State', field: 'lifeCycleState'},
      ]}
      data={data}
      options={{
        selection: true,
        rowStyle: {
          fontSize: '14px'
        }
      }}
      localization={{
        toolbar: {
          nRowsSelected: '{0} application(s) selected'
        },
        body: {
          emptyDataSourceMessage: `No applications found with owner email ${selectedEmail}`
        }
      }}
      onSelectionChange={(rows) => onSelect(rows)}
    />

当我选择所有或单个行复选框时,我应该会在下面看到类似这样的内容(使用 (https://github.com/mbrn/material-table) 的屏幕截图

但我什么也没看到

我在这里错过任何选择吗?

我在 package.json 中的依赖项

  "dependencies": {
    "@emotion/react": "^11.10.4",
    "@emotion/styled": "^11.10.4",
    "@material-table/core": "^0.2.52",
    "@mui/icons-material": "^5.10.6",
    "@mui/lab": "^5.0.0-alpha.100",
    "@mui/material": "^5.10.6",
    "axios": "^0.27.2",
    "filefy": "^0.1.11",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-google-charts": "^4.0.0",
    "react-router-dom": "^6.4.0",
    "react-scripts": "^5.0.1",
    "sass": "^1.54.9"
  }

【问题讨论】:

    标签: reactjs material-ui material-table


    【解决方案1】:

    这已被报告并在 v0.2.53 中得到修复 https://github.com/material-table-core/core/issues/660

    【讨论】:

      猜你喜欢
      • 2018-11-08
      • 2020-07-05
      • 2017-09-02
      • 2021-06-02
      • 2021-03-11
      • 2022-01-04
      • 1970-01-01
      • 2022-06-30
      • 2021-08-11
      相关资源
      最近更新 更多