diff --git a/formily/setters/src/components/DataSourceSetter/TreePanel.tsx b/formily/setters/src/components/DataSourceSetter/TreePanel.tsx index b2f693f2b..f29726253 100644 --- a/formily/setters/src/components/DataSourceSetter/TreePanel.tsx +++ b/formily/setters/src/components/DataSourceSetter/TreePanel.tsx @@ -89,7 +89,9 @@ export const TreePanel: React.FC = observer((props) => { onClick={() => { const uuid = uid() const dataSource = props.treeDataSource.dataSource - const initialKeyValuePairs = props.defaultOptionValue || [ + const initialKeyValuePairs = props.defaultOptionValue.map( + (item) => ({ ...item }) + ) || [ { label: 'label', value: `${GlobalRegistry.getDesignerMessage( @@ -115,7 +117,7 @@ export const TreePanel: React.FC = observer((props) => { true : limitTreeDrag} defaultExpandAll defaultExpandParent autoExpandParent