add more options for JSONEditor

This commit is contained in:
Reorx 2023-02-03 01:04:52 +08:00
parent 1491738fc2
commit ac49be1c94
1 changed files with 4 additions and 1 deletions

View File

@ -86,9 +86,12 @@ const editor = new JSONEditor(elEditorContainer, {
schema: jsoncvSchema, schema: jsoncvSchema,
theme: 'mytheme', theme: 'mytheme',
iconlib: 'myiconlib', iconlib: 'myiconlib',
disable_array_delete_all_rows: true,
no_additional_properties: true,
startval: exampleData,
}); });
editor.on('ready',() => { editor.on('ready',() => {
editor.setValue(exampleData) // editor.setValue(exampleData)
// add anchor to each schema element // add anchor to each schema element
document.querySelectorAll('[data-schemapath]').forEach(el => { document.querySelectorAll('[data-schemapath]').forEach(el => {