场景:如果后端可能直接给你返回json格式的数据 使用:如果不是JSON就正常返回字符串 1 .显示 logContent(xxx.abc.jsonA) 2.计算属性 computed: { logContent() { return function(data) { try { return JSON.parse(data) } catch (error) { return data } } } }