SOURCE

console 命令行工具 X clear

                    
>
console
var app = new Vue({
    el: '#app',
    data() {
        return {
            jsonVal: "",
            strObj: []
        }
    },
    methods: {
        toObj () {
            let fixObj = JSON.parse(this.jsonVal)
            for (i in fixObj) {
                if (typeof fixObj[i] === 'string') {
                    fixObj[i] = `'${fixObj[i]}'`
                }
                this.strObj.push({
                    label: i,
                    val: fixObj[i]
                })
            }
        }
    },
    created() {
        
    }

});
<div id="app">
	<template>
        <input v-model="jsonVal"></input>
        <button @click="toObj"></button>
        <template>
            <div v-for="item in strObj">
                <span>{{item.label}}: </span>
                <span>{{item.val}},</span>
            </div>
        </template>
	</template>
</div>

本项目引用的自定义外部资源