-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧐[request参数不一致]request的sort新版本返回undefined #7369
Comments
你好!根据你的描述和示例代码,我看到你在使用 Ant Design ProTable 组件,并且在 根据 Ant Design ProTable 的文档, 为了解决这个问题,你可以在 以下是一个示例的修改代码: import React from 'react';
import { Button } from 'antd';
import './App.css';
import {ProTable} from '@ant-design/pro-table';
const App = () => (
<div className="App">
<Button type="primary">Button</Button>
<ProTable request={function (params, sort) {
console.log(params, sort)
// 对 sort 参数进行判断和处理
if (typeof sort === 'undefined') {
sort = {};
}
return {
data: [{
index: 1
}, {
index: 2
}, {
index: 3
}, {
index: 4
}, {
index: 5
}],
total: 15
}
}} columns={[
{
dataIndex: 'index',
title: '测试',
width: 100,
align: 'center',
},
]} pagination={{
size: 10,
pageSize: 5
}}></ProTable>
</div>
);
export default App; 通过上述的修改,无论 另外,你也可以查阅 Ant Design ProTable 的官方文档,了解更多关于 希望这个解决方案对你有帮助!如果你还有其他问题,请随时提问。 |
是故意这么做的,不然sort 总是有值,让一些java服务直接挂掉了 |
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🧐 问题描述
之前是返回{}的,现在第一页返回{},翻页后返回undefined
💻 示例代码
🚑 其他信息
The text was updated successfully, but these errors were encountered: