vue json展示组件


vue-json-viewer 组件,简单易用的json内容展示组件,可以伸缩

https://www.npmjs.com/package/vue-json-viewer

https://github.com/chenfengjw163/vue-json-viewer/blob/master/README_CN.md

使用 npm:
$ npm install vue-json-viewer --save

使用 yarn:
$ yarn add vue-json-viewer

使用:

<template>
  <json-viewer :value="jsonData"/>
</template>

<script>
  import JsonViewer from 'vue-json-viewer'

  export default {
    name: "jsons",
    components: {
      JsonViewer
    },
    data() {
      return {
        jsonData: {"id": 2, "userid": "3", "result": [{'id': 1, "h": 4}]},

      }
    }
  }
</script>

<style scoped>

</style>

  

附送: 判断字符是否为json https://blog.csdn.net/zhanghe_zht/article/details/103460533


原文链接:https://blog.csdn.net/zhanghe_zht/article/details/103463590

 

 

另外一个,这个是直接展示开来的 (文本那样)不可伸缩

https://blog.csdn.net/MtangEr/article/details/123402257

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM