From 378aa869bf933d72fa8be1112163483a1982d5c5 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Mon, 8 Sep 2025 13:51:28 +0800 Subject: [PATCH] =?UTF-8?q?style(components):=20=E4=BF=AE=E6=94=B9json?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/custom/json-preview.vue | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/components/custom/json-preview.vue b/src/components/custom/json-preview.vue index 8b28a58b..e8158065 100644 --- a/src/components/custom/json-preview.vue +++ b/src/components/custom/json-preview.vue @@ -2,6 +2,7 @@ import { computed } from 'vue'; import hljs from 'highlight.js/lib/core'; import json from 'highlight.js/lib/languages/json'; +import { twMerge } from 'tailwind-merge'; hljs.registerLanguage('json', json); @@ -10,15 +11,19 @@ defineOptions({ }); interface Props { + class?: string; code?: string; showLineNumbers?: boolean; } const props = withDefaults(defineProps(), { + class: '', code: '', showLineNumbers: false }); +const DEFAULT_CLASS = 'max-h-500px'; + /** 格式化JSON数据 */ const jsonData = computed(() => { if (!props.code) return ''; @@ -33,9 +38,9 @@ const jsonData = computed(() => {