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(() => {