fix(project): fix json editor misalignment when opening modal with large data

This commit is contained in:
lzh
2026-02-24 14:08:24 +08:00
parent 735d553856
commit 9c6080e082
2 changed files with 9 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ import {
import { usePreferences } from '@vben/preferences';
import { useDebounceFn, useWindowSize } from '@vueuse/core';
import { useDebounceFn, useElementSize } from '@vueuse/core';
import CodeMirror from 'codemirror';
import { MODE } from './types';
@@ -41,9 +41,10 @@ const props = withDefaults(defineProps<CodeEditorProps>(), {
const emit = defineEmits(['change']);
const { isDark } = usePreferences();
const { width, height } = useWindowSize();
const el = ref();
const { width, height } = useElementSize(el);
let editor: Nullable<CodeMirror.Editor>;
const debounceRefresh = useDebounceFn(refresh, 100);