<pre id="json"></pre>
jsonData: {
Intent: {
Command: 'search',
SubIntent: null,
},
},
mounted() {
document.getElementById('json').innerHTML = JSON.stringify(this.jsonData, undefined, 2);
},
参考:https://stackoverflow.com/questions/16862627/json-stringify-output-to-div-in-pretty-print-way