vue-json-editors

0.7.7 • Public • Published

vue-json-editors

Vue Json Editor for Vue. 基于Codemirror 使用于Vue的Web Json编辑器。

Installation

NPM
npm install vue-json-editors

Mount

global
import Vue from 'vue'
import VueJsonEditors from 'vue-json-editors'
 
// you can set default global options and events when use
Vue.use(VueJsonEditors, /* { 
  options: { theme: 'rubyblue', lineNumbers:true, ... },
  events: ['scroll', ...]
*/)

Usage

<template>
  <div>
    <vue-json-editor v-model="json" :options="options"/>
  </div>
</template>
 
<script>
  export default {
    name: 'home',
    data() {
      return {
        json: '{}',
        options: {
          //theme:'rubyblue',        //default
          //lineNumbers:true,        //default
          mode: 'application/json',
          readOnly: true
        },
      }
    },
  }
</script>
Methods Description
validate(valid) 验证json格式是否正确
关羽
张飞

Author

JeeSky

Readme

Keywords

none

Package Sidebar

Install

npm i vue-json-editors

Weekly Downloads

2

Version

0.7.7

License

MIT

Unpacked Size

1.45 MB

Total Files

19

Last publish

Collaborators

  • liushuxiang1993