【问题标题】:Material Table ExportButton is missing from the options props选项道具中缺少材料表导出按钮
【发布时间】:2021-08-02 08:32:25
【问题描述】:

我在 MaterialTable 的导出按钮上遇到了问题。添加<MaterialTable options={{exportButton: true}} />后没有出现在表格中

当我进入 MaterialTable 中的 options props 时,我发现 Options interface 中没有找到 exportButton。为了解决这个问题,我尝试删除 node_modules 文件夹并重新安装。

显然,它似乎并没有解决问题。这是我的Options interface 中显示的元素列表。

enter image description here

谁能帮我解决这个问题?

【问题讨论】:

    标签: button export options material-table missing-features


    【解决方案1】:

    尝试像这样设置 MaterialTable options

    options={{
        // ..other options
        exportButton: {
          csv: true,
          pdf: false
        }
    }}
    

    这是一个工作的sandbox的链接。

    【讨论】:

    • 我试过了,没有用。这里最大的问题是exportButton在MaterialTable options props中找不到了,你可以点击我上面分享的图片。
    • @jeomjeom 也许我们在不同版本的MaterialTable 上?我提供的工作沙箱使用的是1.69.1
    • 谢谢,@NicoE。问题解决了。我使用的是@material-table/core,而不是mbrn/material-table。他们有不同的道具。
    猜你喜欢
    • 2021-06-04
    • 2020-08-22
    • 1970-01-01
    • 2020-11-03
    • 2018-05-19
    • 1970-01-01
    • 2019-02-26
    • 2020-03-21
    • 2021-03-08
    相关资源
    最近更新 更多