mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
Use VueUse unrefElement
This commit is contained in:
@@ -60,6 +60,7 @@ import {
|
|||||||
useDraggable,
|
useDraggable,
|
||||||
useEventListener,
|
useEventListener,
|
||||||
useLocalStorage,
|
useLocalStorage,
|
||||||
|
unrefElement,
|
||||||
watchDebounced
|
watchDebounced
|
||||||
} from '@vueuse/core'
|
} from '@vueuse/core'
|
||||||
import { clamp } from 'es-toolkit/compat'
|
import { clamp } from 'es-toolkit/compat'
|
||||||
@@ -101,9 +102,10 @@ const isQueuePanelV2Enabled = computed(() =>
|
|||||||
)
|
)
|
||||||
|
|
||||||
const panelRef = ref<ComponentPublicInstance | null>(null)
|
const panelRef = ref<ComponentPublicInstance | null>(null)
|
||||||
const panelElement = computed(
|
const panelElement = computed<HTMLElement | null>(() => {
|
||||||
() => (panelRef.value?.$el as HTMLElement | undefined) ?? null
|
const element = unrefElement(panelRef)
|
||||||
)
|
return element instanceof HTMLElement ? element : null
|
||||||
|
})
|
||||||
const dragHandleRef = ref<HTMLElement | null>(null)
|
const dragHandleRef = ref<HTMLElement | null>(null)
|
||||||
const isDocked = useLocalStorage('Comfy.MenuPosition.Docked', true)
|
const isDocked = useLocalStorage('Comfy.MenuPosition.Docked', true)
|
||||||
const storedPosition = useLocalStorage('Comfy.MenuPosition.Floating', {
|
const storedPosition = useLocalStorage('Comfy.MenuPosition.Floating', {
|
||||||
|
|||||||
Reference in New Issue
Block a user