js json生取key,value 值
this.dataView = []; if (data.dataView && data.dataView != null) { let dataViewArr = JSON.parse(data.dataView); for (var key in dataViewArr) { this.dataView.push({ key: key, value: dataViewArr[key] }); } }
<div v-if="dataView.length > 0"> <p v-for="item in dataView"> <span>{{item.key}}:</span> {{item.value}} </p> </div>