1.首先引入vue-json-editor
npm install vue-json-editor --save
或
cnpm install vue-json-editor --save
2.引入组件
import vueJsonEditor from 'vue-json-editor'
3.components定义
components: {
vueJsonEditor
}
4.界面使用
<vueJsonEditor
v-loading="bookingLoad"
v-model="bookingAfter"
:show-btns="false"
:mode="'code'"
style="height:500px"
lang="zh"></vueJsonEditor>
注意:在这边定义style的高度目前是不生效的
需要加入style
.jsoneditor-vue{
height: 100%;
}