Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function settingsView(configin) {
console.log(configin)
$('#micboard').hide();
$('.settings').show();
let editor_div = document.getElementById('editor_holder')
editor_div.innerHTML = ''
var editor = new JSONEditor(editor_div,{
// Enable fetching schemas via ajax
ajax: false,
theme: 'bootstrap4',
// The schema for the editor
schema: {
"title": " ",
"type" : "object",
// "format": "categories",
"options" : {
"disable_properties": true,
"disable_edit_json" : true,
"disable_collapse": true
},
"properties" : {
"port" : {
createInstence() {
this.editor = new JSONEditor(this.$refs.jsonEditor, {
theme: "bootstrap4",
iconlib: "fontawesome4",
schema: this.schema,
startval: this.originValue,
required_by_default: true,
disable_array_reorder: true,
no_additional_properties: true,
});
this.editor.on("change", () => {
const errors = this.editor.validate();
if (errors.length) {
this.$message.error("json语法有误,请检查");
} else {
const json = this.editor.getValue();
this.originStrinfyVal = JSON.stringify(json, null, 2);
}