refactor: fix some type errors
This commit is contained in:
parent
09b47fc402
commit
7387cae138
13 changed files with 85 additions and 84 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue