as mentioned, I can now print the data line by line in the front console, but there is no way to display it on the page. The front-end code is as follows:
<template>
...
<el-form>
<el-form-item
v-for="(item, index) in searchRst"
:key="item.key"
:prop=""searchRst." + index + ".value""
>
<el-input style="width: 200px" v-model="item.content" placeholder="treatment name"></el-input>
</el-form-item>
</el-form>
...
</template>
<script>
...
export default{
data() {
return {
searchRst: [{
content: ""
}
]
}
},
mounted: function(){
this.getAbHistory();
},
methods:{
getAbHistory(){
axios.get("/historyScan/AbHistory").then(result =>{
var res = result.data;
if(res.status == "0"){
let values = res.result.hbaseRst;
for (let i = 0; i < values.length; iPP) {
this.searchRst.content = JSON.stringify(values[i]);
console.log("A/B history is "+ this.searchRst.content);
}
}
else{
this.$message.error("A/B test ");
}
});
}
}
}
</script>
the data printed by the front console is as follows:
what I want to do now is to display the data line by line on the page, but now I can"t bind it in both directions with v-model. There are only input boxes on the page, but there are no values. Please take a look at them. Thank you
.