forked from p96170835/amis
json 开启验证放在 components 里面
This commit is contained in:
parent
8783ce1c21
commit
333e4035e3
|
@ -339,6 +339,12 @@ export class Editor extends React.Component<EditorProps, any> {
|
|||
theme: editorTheme,
|
||||
});
|
||||
|
||||
// json 默认开启验证。
|
||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
enableSchemaRequest: true,
|
||||
validate: true
|
||||
});
|
||||
|
||||
// After initializing monaco editor
|
||||
this.editorDidMount(this.editor, monaco);
|
||||
}
|
||||
|
|
|
@ -69,12 +69,6 @@ export default class EditorControl extends React.Component<EditorProps, any> {
|
|||
this.toDispose.push(editor.onDidFocusEditorWidget(this.updateContainerSize).dispose);
|
||||
this.toDispose.push(editor.onDidChangeModelContent(this.updateContainerSize).dispose);
|
||||
this.props.editorDidMount && this.props.editorDidMount(editor, monaco);
|
||||
|
||||
// json 默认开启验证。
|
||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
enableSchemaRequest: true,
|
||||
validate: true
|
||||
});
|
||||
}
|
||||
|
||||
updateContainerSize() {
|
||||
|
|
Loading…
Reference in New Issue