Commit 501f1dbf authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复 dataSource 不存在报错的问题

parent 25f23d87
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-08-20 16:15:59 * @Date: 2020-08-20 16:15:59
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-28 17:39:18 * @LastEditTime: 2021-07-29 14:08:56
* @Description: 可以带查询的表格,内置 formily,如果需要其他Form可以传入 customRenderSearchForm 配合 reload() 实现查询 * @Description: 可以带查询的表格,内置 formily,如果需要其他Form可以传入 customRenderSearchForm 配合 reload() 实现查询
*/ */
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'; import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
...@@ -90,7 +90,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm ...@@ -90,7 +90,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm
return { return {
...prevState, ...prevState,
data: props.dataSource as T[], data: props.dataSource as T[],
totalCount: props.dataSource.length, totalCount: props.dataSource?.length || 0,
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment