feat: new component jsonViewer (#5544)

* 添加新组件JsonViewer用于展示JSON结构数据
This commit is contained in:
Netfan
2025-02-16 22:57:00 +08:00
committed by GitHub
parent f9504cece3
commit 6cba181fad
13 changed files with 356 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
<script lang="ts" setup>
import { JsonViewer, Page } from '@vben/common-ui';
import { Card } from 'ant-design-vue';
import { json1, json2 } from './data';
</script>
<template>
<Page
title="Json Viewer"
description="一个渲染 JSON 结构数据的组件,支持复制、展开等,简单易用"
>
<Card title="默认配置">
<JsonViewer v-model="json1" />
</Card>
<Card title="可复制、默认展开3层、显示边框" class="mt-4">
<JsonViewer
v-model="json2"
:expand-depth="3"
copyable
:sort="false"
boxed
/>
</Card>
</Page>
</template>