From abd3efa318ccb8f370e8f3df83a28735c1e4f45d Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 11 Oct 2021 02:47:23 +0900 Subject: [PATCH] chore: fix error --- src/client/components/global/header.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client/components/global/header.vue b/src/client/components/global/header.vue index 346bf42611..176a1b47ea 100644 --- a/src/client/components/global/header.vue +++ b/src/client/components/global/header.vue @@ -153,9 +153,15 @@ export default defineComponent({ if (el.value.parentElement) { narrow.value = el.value.parentElement.offsetWidth < 500; - new ResizeObserver((entries, observer) => { - narrow.value = el.value.parentElement.offsetWidth < 500; - }).observe(el.value.parentElement); + const ro = new ResizeObserver((entries, observer) => { + if (el.value) { + narrow.value = el.value.parentElement.offsetWidth < 500; + } + }); + ro.observe(el.value.parentElement); + onUnmounted(() => { + ro.disconnect(); + }); setTimeout(() => { const currentStickyTop = getComputedStyle(el.value.parentElement).getPropertyValue('--stickyTop') || '0px'; el.value.style.setProperty('--stickyTop', currentStickyTop); @@ -191,6 +197,7 @@ export default defineComponent({ width: 100%; -webkit-backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--blur, blur(15px)); + border-bottom: solid 0.5px var(--divider); &.thin { --height: 50px;