(stacked notes) implements overlay

This commit is contained in:
2021-03-14 15:21:14 +01:00
parent cd381f9c4a
commit 698c865b39
6 changed files with 172 additions and 45 deletions

View File

@@ -0,0 +1,27 @@
import { onMounted, ref } from 'vue'
import { useEventListener } from '@vueuse/core'
export const useOverlay = () => {
const x = ref(0)
onMounted(() => {
const element = document.querySelector('body')
useEventListener(
element,
'scroll',
(e) => {
const target = e.target as HTMLElement
x.value = target.scrollLeft
},
{
passive: true,
capture: false
}
)
})
return {
x
}
}