guard against null root.value in Marquee (???)

feat/vaults
Tomáš Mládek 2021-06-20 17:25:06 +02:00
parent 8d02371d17
commit 30bf54f037
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ export default defineComponent({
speed: {
default: 30,
type: Number,
}
},
},
setup(props) {
const root = ref<HTMLDivElement | null>(null);
@ -31,6 +31,7 @@ export default defineComponent({
onMounted(() => {
const resizeObserver = new ResizeObserver(() => {
if (!root.value) return;
overflowed.value = root.value!.scrollWidth > root.value!.clientWidth;
shiftWidth.value = `-${
inner.value!.clientWidth - root.value!.clientWidth