瀏覽代碼

bug修复

Leo 2 年之前
父節點
當前提交
2ab1517cea
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/module/datasource/component/DatasourceData.jsx

+ 3 - 1
src/module/datasource/component/DatasourceData.jsx

@@ -56,7 +56,9 @@ const DatasourceData = props => {
   }, [data])
 
   useEffect(() => {
-    onSelect(treeData[0]?.key)
+    if (treeData[0]) {
+      onSelect(treeData[0].key)
+    }
   }, [treeData])
 
   const onSelect = selectedKeys => {