refactor: fix some type errors

This commit is contained in:
yukineko 2024-01-09 01:10:47 +09:00
parent 09b47fc402
commit 7387cae138
No known key found for this signature in database
GPG key ID: E5BACB72109B7B90
13 changed files with 85 additions and 84 deletions

View file

@ -51,7 +51,7 @@ const bodyWidth = ref(0);
const bodyHeight = ref(0);
const close = () => {
modal.value.close();
modal.value?.close();
};
const onBgClick = () => {
@ -67,11 +67,13 @@ const onKeydown = (evt) => {
};
const ro = new ResizeObserver((entries, observer) => {
if (!rootEl.value || !headerEl.value) return;
bodyWidth.value = rootEl.value.offsetWidth;
bodyHeight.value = rootEl.value.offsetHeight - headerEl.value.offsetHeight;
});
onMounted(() => {
if (!rootEl.value || !headerEl.value) return;
bodyWidth.value = rootEl.value.offsetWidth;
bodyHeight.value = rootEl.value.offsetHeight - headerEl.value.offsetHeight;
ro.observe(rootEl.value);