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