@@ -181,6 +182,8 @@ import { getBoardApi } from '@/views/boardGenerate/api/boardList';
const router = useRouter();
+const contentRef = ref();
+
const nodes = ref([]);
const edges = ref([]);
const area = ref({});
@@ -259,13 +262,15 @@ onMounted(async () => {
};
}) || [];
area.value = JSON.parse(data.customContent) || {};
+ console.log('area.value', area.value);
if (!area.value.width) {
- const screenWidth = window.screen.width;
- ratioWidth.value = screenWidth / 1920;
+ const { offsetWidth } = contentRef.value;
+ console.log('offsetWidth', offsetWidth);
+ ratioWidth.value = offsetWidth / 1920;
}
if (!area.value.height) {
- const screenHeight = window.screen.height;
- ratioHeight.value = screenHeight / 1080;
+ const { offsetHeight } = contentRef.value;
+ ratioHeight.value = offsetHeight / 1080;
}
});
});