Skip to content

mm-sam/json-textarea

 
 

Repository files navigation

JSON textarea

visual JSON editor with comments

fork from Vue-Json-Edit

Online Demo

Usage

<textarea name="hello" class="json_editor">
    [1, 2, 3, "Hello"]
</textarea>

<script src="path/of/json-textarea.js"></script>
  

OR

<textarea name="json" class="my-class">
    [1, 2, 3, "Hello"]
</textarea>

<script src="path/of/json-textarea.js"></script>
<script>
    JSONTextArea.Launcher.init(".my-class", {
        comments: {}, //comments data
        /**
         * comments save callback
         **/
        updateComments: function(e) {
            //do something
        }
    })
</script>
  

Options

  • comments:
{
    "json path": "comments text"
    //....
}
  • updateComments:
updateComments : function (e) {
    console.log(e.key); //JSON path
    console.log(e.comments); //comments text
    console.log(e.target); //textarea element
}

About

visual JSON editor with comments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 57.3%
  • Vue 31.5%
  • JavaScript 7.3%
  • CSS 3.9%