V3 UI - Tabs & Menu rework (#4374)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
pythongosssss
2025-07-24 08:09:12 +01:00
committed by GitHub
parent 2338cbd4c9
commit 62f3ba0689
33 changed files with 1057 additions and 231 deletions

View File

@@ -0,0 +1,27 @@
import { useEventListener } from '@vueuse/core'
export const whileMouseDown = (
elementOrEvent: HTMLElement | Event,
callback: (iteration: number) => void,
interval: number = 30
) => {
const element =
elementOrEvent instanceof HTMLElement
? elementOrEvent
: (elementOrEvent.target as HTMLElement)
let iteration = 0
const intervalId = setInterval(() => {
callback(iteration++)
}, interval)
const dispose = useEventListener(element, 'mouseup', () => {
clearInterval(intervalId)
dispose()
})
return {
dispose
}
}