Files
Jérémie Pardouandpeter_baserow d01cd849f6 Workflow action perf issues for create/update action with many fields (#4302)
* improve performances for workflow automations

* Improve performances of local baserow upsert form

* Revert to the old placeholder string.

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2025-11-20 14:06:40 +01:00

33 lines
707 B
Vue

<template>
<div ref="rootEl">
<template v-if="isVisible">
<slot />
</template>
<template v-else><slot name="placeholder">...</slot></template>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
const isVisible = ref(false)
const rootEl = ref(null)
let observer = null
onMounted(() => {
observer = new IntersectionObserver(
(entries) => {
// Update visibility based on intersection
if (entries[0].isIntersecting) isVisible.value = true
},
{ threshold: 0.1 }
)
if (rootEl.value) observer.observe(rootEl.value)
})
onBeforeUnmount(() => {
if (observer && rootEl.value) observer.unobserve(rootEl.value)
})
</script>