# Json editor
This article uses a third-party Json editor v-jsoneditor (opens new window)
# Effect
# Installation
Node
npm install v-jsoneditor
Browser
<script src="https://unpkg.com/v-jsoneditor/docs/dist/v-jsoneditor.min.js"></script>
# Import
Node
import VJsoneditor from 'v-jsoneditor'
Browser
var VJsoneditor = window.VJsoneditor.default;
# Mounting
Vue.use(VJsoneditor);
//or
Vue.component('VJsoneditor', VJsoneditor);
//or
formCreate.component('VJsoneditor', VJsoneditor);
# Generate
fApi = formCreate.create([
{
type: 'v-jsoneditor',
title: 'json',
field: 'json',
value:{
type: 'form-create'
}
}
])
# Modify
fApi.setValue('json', {type: 'form-create v2'})