fix cannot read "body" from undefined (#5387)

This commit is contained in:
Truman Gao
2026-02-18 10:43:14 -07:00
committed by GitHub
parent 0e752ab415
commit b62bc6f3b8

View File

@@ -8,13 +8,13 @@ const props = defineProps<{
watch(
() => props.shown,
(shown) => {
document.body.classList.toggle('floating-action-bar-shown', shown)
document?.body.classList.toggle('floating-action-bar-shown', shown)
},
{ immediate: true },
)
onUnmounted(() => {
document.body.classList.remove('floating-action-bar-shown')
document?.body.classList.remove('floating-action-bar-shown')
})
</script>