【发布时间】:2022-08-09 16:49:22
【问题描述】:
我试图在 Typescript 中实现 \"Server side pagination, filter and sorting sample\"。
我使用QTableProps[\'onRequest\'] 进行道具输入,但它不起作用:
function onRequest (props: QTableProps[\'onRequest\']) {
console.log(props);
}
这是 TS 报告的错误:
Type \'(props: ((requestProp: { pagination: { sortBy: string; descending: boolean; page: number; rowsPerPage: number; }; filter: (rows: readonly any[], terms: any, cols?: readonly any[] | undefined, getCellValue?: ((col: any, row: any) => any) | undefined) => readonly any[]; getCellValue: (col: any, row: any) => any; }) =>...\' is not assignable to type \'(requestProp: { pagination: { sortBy: string; descending: boolean; page: number; rowsPerPage: number; }; filter: (rows: readonly any[], terms: any, cols?: readonly any[] | undefined, getCellValue?: ((col: any, row: any) => any) | undefined) => readonly any[]; getCellValue: (col: any, row: any) => any; }) => void\'.
Types of parameters \'props\' and \'requestProp\' are incompatible.