Skip to content

Commit

Permalink
UI中json配置器,允许注释 #79
Browse files Browse the repository at this point in the history
  • Loading branch information
wlclass committed Dec 25, 2022
1 parent 147bbb1 commit 4a945f3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ const JsonEditor: React.FC<JsonEditorProps> = (props) => {
defaultValue=""
value={json}
options={{ minimap: { enabled: false } }}
beforeMount={(monaco) => {
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true,
allowComments: true,//是否允许json内容中带注释
schemaValidation: 'error',
});
}}
onChange={(v, e) => {
setJson(v);
}}
Expand Down

0 comments on commit 4a945f3

Please sign in to comment.