I think that when resizing, your code simply needs to rearrange how the datas are displayed on the screen.
As you have 3000 thousands records, it takes some time.
Can you show the code inside <div v-else>...</div> please ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I'm open to speeding up resize by rendering only some records first, but I do eventually want the 3000 records on that single page, this makes it easier for the user to search and lessen calls to the server
<template>
<div v-if="isLoading">Loading...</div>
<div v-else>
<!-- 3000 records -->
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, nextTick, onUpdated } from 'vue'
const isLoading = ref<boolean>(true)
const json = ref<any>([])
function onResize() {
isLoading.value = true
}
onMounted(async () => {
const response = await fetch('data.json')
json.value = await response.json()
window.addEventListener('resize', onResize)
nextTick(() => {
isLoading.value = false
})
})
onUpdated(() => {
nextTick(() => {
isLoading.value = false
})
})
</script>
Please or to participate in this conversation.