1. vue-json-editor_lily

vue-json-editor_lily

vue-json-editor_lily

Visual JSON Editor built as an vue component. Provides a basic GUI


开始

npm install vue-json-editor_lily --save

使用

 //import it in your project At your entry point

import Vue from 'vue'
import JsonEditor from 'vue-json-editor_lily'
  
Vue.use(JsonEditor)

参数

  • objData: json data
  • options
    • confirmText: strings of the confirm button
    • cancelText: strings of the cancel button
  • event
    • key click event
    • value click event

样例

 
<template>
    <JsonEditor
        :options="{
            confirmText: '确认',
            cancelText: '取消',
        }"
        @keyEvent="keyEvent"
        @valEvent="valEvent"
        :objData="jsonData" 
        v-model="jsonData" >
    </JsonEditor>
</template>
<script>
export default {
    ...
    data: function() {
        return {
            jsonData: {
                name: 'Bill',
                age: 23,
                city: 'Seattle'
            }
        }
    }
}
</script>