使用 ?.避免在表格实例不存在出现错误

pull/120/head
puhui999 2023-04-13 16:43:29 +08:00
parent 0447fdb9c9
commit 6fb5f6f59e
1 changed files with 1 additions and 1 deletions

View File

@ -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),