fix cannot read "body" from undefined (#5387)
This commit is contained in:
@@ -8,13 +8,13 @@ const props = defineProps<{
|
|||||||
watch(
|
watch(
|
||||||
() => props.shown,
|
() => props.shown,
|
||||||
(shown) => {
|
(shown) => {
|
||||||
document.body.classList.toggle('floating-action-bar-shown', shown)
|
document?.body.classList.toggle('floating-action-bar-shown', shown)
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.body.classList.remove('floating-action-bar-shown')
|
document?.body.classList.remove('floating-action-bar-shown')
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user