current position:Home>How to solve the data binding failure when Vue JSON editor is used in vue3?

How to solve the data binding failure when Vue JSON editor is used in vue3?

2022-01-27 01:58:15 CSDN Q & A

<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> //  The import module  import vueJsonEditor from 'vue-json-editor' export default { //  Certified components  components: { vueJsonEditor }, data() { return { hasJsonFlag:true, // json Whether the verification is passed  // json data  run_res: "", } }, mounted: function() { }, methods: { contrast() { console.log(111, this.run_res) var self = this; let ttoken = JSON.parse(localStorage.getItem("user_data")); this.$"/contrast_json/",this.formInline, { 
    headers: { 
    Authorization: "Bearer "+ttoken.token}}) .then((Response) => { this.$message({ message: " Data created ", 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;}/*  Frame  */div.jsoneditor-menu { background-color: #303133; border-bottom: 1px solid #303133;}/*  Content  */div.ace-jsoneditor .ace_scroller { background-color: #303133;}/*  The side  */div.ace-jsoneditor .ace_gutter { background: #303133; color: white;}//  Mark div.ace-jsoneditor .ace_marker-layer .ace_active-line { background: #409EFF;}//  Content text div.ace-jsoneditor .ace_variable { color: #ffffff;}div.ace-jsoneditor .ace_string { color: #ffffff;}div.ace-jsoneditor .ace_constant.ace_numeric { color: #ffffff;}//  Content punctuation div.ace-jsoneditor .ace_text-layer { color: #ffffff;}div.ace-jsoneditor .ace_gutter-active-line { background-color: #409EFF;}</style>```javascript


Refer to the answer 1:

Hello , I am a little assistant who answers every question , So sorry , This time, you have to answer all your questions , The panel of technical experts timed out and did not answer for you

The number of times to answer all questions deducted from this question , Will answer with questions VIP Experience card (1 A chance to answer every question 、 Shopping malls buy physical books and enjoy 95 A discount ) It will be reissued to your account in the form of .

Because all questions must be answered VIP The experience card is only valid for 1 God , When you need it 【 Direct messages 】 Contact me , I'll reissue it for you .

Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.

Random recommended