vue-json-viewer 展示json数据

main.js

import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer);

vue

<el-dialog title="退款数据详情" :visible.sync="dialogvisible2" v-if="dialogvisible2">
      <json-viewer :value="jsondata" sort :expand-depth="5"></json-viewer>
    </el-dialog>
methods: {
    showrawdata(data) {
      this.loading = true;
      refundAPI.refundQuery_RawData({ outRefundNo: data.outRefundNo }).then(
        data => {
          if (data.code == 0) {
            this.jsondata = data.data;
            this.dialogvisible2 = true;
          } else {
            this.$message({
              message: data.message,
              type: 'warning',
            });
          }
          this.loading = false;
        }
      )
    },
  },

 

posted @ 2023-03-20 17:50  天天的蓝色  阅读(360)  评论(0编辑  收藏  举报