fix(project): fix json editor misalignment when opening modal with large data
This commit is contained in:
@@ -17,6 +17,8 @@ const emit = defineEmits<{ (e: 'success'): void }>();
|
||||
const relation = ref<null | OpsAreaApi.AreaDeviceRelation>(null);
|
||||
const jsonValue = ref('');
|
||||
|
||||
const isOpen = ref(false);
|
||||
|
||||
const title = computed(() => {
|
||||
const r = relation.value;
|
||||
if (!r) return '设备配置';
|
||||
@@ -60,8 +62,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
async onOpenChange(open: boolean) {
|
||||
isOpen.value = open;
|
||||
if (!open) {
|
||||
relation.value = null;
|
||||
jsonValue.value = '';
|
||||
return;
|
||||
@@ -80,6 +83,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
<Modal :title="title">
|
||||
<div class="h-[400px] w-full px-4">
|
||||
<CodeEditor
|
||||
v-if="isOpen"
|
||||
:value="jsonValue"
|
||||
:bordered="true"
|
||||
:auto-format="false"
|
||||
|
||||
Reference in New Issue
Block a user