feat: enhance FastRequest functionality with shift scheduling and improve payment callback handling
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { onBeforeUnmount, ref, watch } from 'vue'
|
||||
|
||||
export function useAnimatedHeight(contentRef) {
|
||||
const height = ref(null)
|
||||
let observer = null
|
||||
|
||||
watch(contentRef, (element) => {
|
||||
observer?.disconnect()
|
||||
observer = null
|
||||
|
||||
if (!element) {
|
||||
height.value = null
|
||||
return
|
||||
}
|
||||
|
||||
observer = new ResizeObserver(([entry]) => {
|
||||
height.value = entry.contentRect.height
|
||||
})
|
||||
observer.observe(element)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => observer?.disconnect())
|
||||
|
||||
return height
|
||||
}
|
||||
Reference in New Issue
Block a user