Skip to content

Commit

Permalink
Rebase and port over tiles from ODS
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Nov 21, 2022
1 parent 318bf64 commit 7ab84df
Show file tree
Hide file tree
Showing 4 changed files with 468 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<li ref="observerTarget" tabindex="-1">
<slot />
</li>
</template>
<script>
import { customRef, computed, ref, unref } from 'vue'
import { useIsVisible } from '../../composables'
export default {
name: 'OcSingeTile',
status: 'ready',
release: '1.0.0',
setup(props) {
const observerTarget = customRef((track, trigger) => {
let $el
return {
get() {
track()
return $el
},
set(value) {
$el = value
trigger()
}
}
})
const lazyColspan = ref(null)
if (props.lazy) {
// lazyColspan.value = props.lazy.colspan
}
const { isVisible } = props.lazy
? useIsVisible({
...props.lazy,
target: observerTarget
})
: { isVisible: ref(true) }
const isHidden = computed(() => !unref(isVisible))
return {
observerTarget,
isHidden,
lazyColspan
}
}
}
</script>
Loading

0 comments on commit 7ab84df

Please sign in to comment.