sorting
This commit is contained in:
parent
2b272ee249
commit
0411bc8f47
1 changed files with 13 additions and 11 deletions
|
|
@ -261,21 +261,10 @@ export default {
|
||||||
|
|
||||||
// # Virtual scrolling stuff
|
// # Virtual scrolling stuff
|
||||||
const body = useTemplateRef('body')
|
const body = useTemplateRef('body')
|
||||||
const { virtualHidden } = toRefs(props)
|
|
||||||
const virtualHeight = ref(120)
|
const virtualHeight = ref(120)
|
||||||
const hiddenStyle = computed(() => ({
|
const hiddenStyle = computed(() => ({
|
||||||
height: this.virtualHeight + 'px',
|
height: this.virtualHeight + 'px',
|
||||||
}))
|
}))
|
||||||
const unsuspendibleIds = ref(new Set())
|
|
||||||
const suspendable = computed(() => unsuspendibleIds.value.size === 0)
|
|
||||||
const hide = computed(() => virtualHidden.value && suspendable.value)
|
|
||||||
const onStatusSuspendStateChange = ({ id, suspend }) => {
|
|
||||||
if (!suspend) {
|
|
||||||
unsuspendibleIds.value.add(id)
|
|
||||||
} else {
|
|
||||||
unsuspendibleIds.value.delete(id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const updateVirtualHeight = () => {
|
const updateVirtualHeight = () => {
|
||||||
if (hide) return // no updates when not rendering
|
if (hide) return // no updates when not rendering
|
||||||
if (!status.value) return // not loaded yet
|
if (!status.value) return // not loaded yet
|
||||||
|
|
@ -288,6 +277,19 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const unsuspendibleIds = ref(new Set())
|
||||||
|
const suspendable = computed(() => unsuspendibleIds.value.size === 0)
|
||||||
|
const onStatusSuspendStateChange = ({ id, suspend }) => {
|
||||||
|
if (!suspend) {
|
||||||
|
unsuspendibleIds.value.add(id)
|
||||||
|
} else {
|
||||||
|
unsuspendibleIds.value.delete(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const { virtualHidden } = toRefs(props)
|
||||||
|
const hide = computed(() => virtualHidden.value && suspendable.value)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
updateVirtualHeight()
|
updateVirtualHeight()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue