Skip to content

Commit

Permalink
React schema editor 优化 (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
laughing-pic-zhu authored Mar 22, 2020
1 parent b6966b9 commit c61d595
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/react-schema-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@ant-design/compatible": "^0.0.1-rc.1",
"@ant-design/icons": "^4.0.3",
"@formily/antd": "^1.0.9",
"antd": "^4.0",
"lodash": "^4.17.15"
Expand Down
6 changes: 5 additions & 1 deletion packages/react-schema-editor/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const SchemaEditor: React.FC<{
}

const handleSchemaChange = (schema: string) => {
onChange(JSON.parse(schema))
try {
onChange(JSON.parse(schema))
} catch (e) {
console.error(e);
}
}

const isRoot = selectedPath === 'root'
Expand Down

0 comments on commit c61d595

Please sign in to comment.