From 77c4a204a88c4b223db5744afd1c11638dce41d2 Mon Sep 17 00:00:00 2001 From: Zehao Date: Thu, 12 Sep 2024 07:43:57 +0800 Subject: [PATCH] fix(skeleton): layout shifting due to delayed rendering (#2383) --- src/components/KSkeleton/KSkeleton.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/KSkeleton/KSkeleton.vue b/src/components/KSkeleton/KSkeleton.vue index 91b7439027..de60c76e5f 100644 --- a/src/components/KSkeleton/KSkeleton.vue +++ b/src/components/KSkeleton/KSkeleton.vue @@ -115,9 +115,12 @@ const props = defineProps({ }, }) -const isVisible = ref(false) +const isVisible = ref(props.delayMilliseconds === 0) onMounted(() => { + if (isVisible.value) { + return + } setTimeout(() => { isVisible.value = true }, props.delayMilliseconds)