ExportButton的resource属性没有任何作用react-admin 3.7.1

问题描述

我最近将react-admin的版本从2.7更新为3.7.1
我曾经使用ExportButton向后端和我的后端发送api调用导出csv用来从后端提供服务。

我过去通过ExportButton resource道具来操纵api调用的方式。但是,由于我已迁移到较新的版本,所以我看到将任何内容传递给资源属性都没有效果,因此该URL由页面的URL生成

我找不到任何有关ExportButton进行了新更改的信息,也找不到关于github存储库上所述的任何问题的信息。

先谢谢您

const ListActions = ({ 
  resource,filterValues,total,maxResults,currentSort,exporter,permanentFilter,showFilter,displayedFilters,filters,}) => {
  return (
     <TopToolbar style={TopToolbarStyle}>
        {filters && cloneElement(filters,{
         resource,context: 'button',})}
       <RefreshButton />
       <ExportButton
         disabled={total === 0}
         resource={resource + '_csv'} // used to changs page's url eg: page is home -> home_csv
         sort={currentSort}
         filter={{ ...filterValues,...permanentFilter }}
         exporter={exporter}
         maxResults={maxResults}
       />
     </TopToolbar>
   )
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)