Vue中格式化json数据
Vue中 格式化 json 数据
-
安装
vue-json-viewernpm install vue-json-viewer --save -
在
main.js中配置// json格式化显示 import JsonViewer from 'vue-json-viewer' Vue.use(JsonViewer) -
vue-json-viewer使用<json-viewer :value="props.row.request_args" :expand-depth=4 sort></json-viewer> -
参数
属性 描述 默认值 value JSON data (can be used with v-model)expand-depth Collapse blocs under this depth 1 copyable Display the copy button, you can customize copy text just set {copyText: 'copy', copiedText: 'copied', timeout: 2000}or settrueuse default copytextfalse sort Sort keys before displaying false boxed Add a fancy "boxed" style to component false -
图


浙公网安备 33010602011771号