fix(project): fix json editor misalignment when opening modal with large data
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user