使用 ?.避免在表格实例不存在出现错误
parent
0447fdb9c9
commit
6fb5f6f59e
|
|
@ -27,7 +27,7 @@ export const useXTable = (props: XTableProps): [Function, tableMethod] => {
|
|||
}
|
||||
const methods: tableMethod = {
|
||||
reload: () => getInstance().reload(),
|
||||
setProps: (props) => getInstance().setProps(props),
|
||||
setProps: (props) => getInstance()?.setProps(props),
|
||||
deleteData: (id: string | number) => getInstance().deleteData(id),
|
||||
deleteBatch: () => getInstance().deleteBatch(),
|
||||
exportList: (fileName?: string) => getInstance().exportList(fileName),
|
||||
|
|
|
|||
Loading…
Reference in New Issue