<template>
<div>
<div class="run_res">
<vue-json-editor
v-model="run_res1"
:mode="'code'"
:showBtns="false"
lang="zh"
@json-change="onJsonChange"
@json-save="onJsonSave"
@has-error="onError"
/>
</div>
</div>
</template>
<script>
// 导入模块
import vueJsonEditor from 'vue-json-editor'
export default {
// 注册组件
components: { vueJsonEditor },
data() {
return {
hasJsonFlag:true, // json是否验证通过
// json数据
run_res: "",
}
},
mounted: function() {
},
methods: {
contrast() {
console.log(111, this.run_res)
var self = this;
let ttoken = JSON.parse(localStorage.getItem("user_data"));
this.$http.post("/contrast_json/",this.formInline, {headers: {Authorization: "Bearer "+ttoken.token}})
.then((Response) => {
this.$message({
message: "数据已创建",
type: "success",
});
});
},
}
}
</script>
<style lang="less">
.run_res {
position: absolute;
width: 40%;
height: 100%;
}
div.jsoneditor {
position: absolute;
width: 100%;
height: 100%;
background-color: #303133;
border-radius: 4px;
}
/* 边框 */
div.jsoneditor-menu {
background-color: #303133;
border-bottom: 1px solid #303133;
}
/* 内容 */
div.ace-jsoneditor .ace_scroller {
background-color: #303133;
}
/* 侧边 */
div.ace-jsoneditor .ace_gutter {
background: #303133;
color: white;
}
// 标记
div.ace-jsoneditor .ace_marker-layer .ace_active-line {
background: #409EFF;
}
// 内容文字
div.ace-jsoneditor .ace_variable {
color: #ffffff;
}
div.ace-jsoneditor .ace_string {
color: #ffffff;
}
div.ace-jsoneditor .ace_constant.ace_numeric {
color: #ffffff;
}
// 内容标点
div.ace-jsoneditor .ace_text-layer {
color: #ffffff;
}
div.ace-jsoneditor .ace_gutter-active-line {
background-color: #409EFF;
}
</style>
```javascript
```
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。
因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。