How to use @json-editor/json-editor - 2 common examples

To help you get started, we’ve selected a few @json-editor/json-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karlcswanson / micboard / js / settings.js View on Github external
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" : {
github housepower / ckman / frontend / src / views / loader / manage.vue View on Github external
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);
        }

@json-editor/json-editor

JSON Schema based editor

MIT
Latest version published 28 days ago

Package Health Score

92 / 100
Full package analysis

Popular @json-editor/json-editor functions