fix tabel transition

This commit is contained in:
Geriano
2022-07-31 11:41:43 +07:00
parent dd3a9be30f
commit 3280bbffae
3 changed files with 66 additions and 91 deletions

View File

@@ -14,7 +14,7 @@ const { url, sticky } = defineProps({
})
const paginator = ref({})
const processing = ref(true)
const processing = ref(false)
const last = ref(null)
const config = useForm({
page: 1,

View File

@@ -136,13 +136,9 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</template>
<template #tbody="{ data, processing, empty, refresh }">
<TransitionGroup
enterActiveClass="transition-all duration-300"
leaveActiveClass="transition-all duration-100"
enterFromClass="opacity-0"
leaveToClass="opacity-0">
<TransitionGroup enterActiveClass="transition-all duration-200" leaveActiveClass="transition-all duration-200" enterFromClass="opacity-0 -scale-y-100" leaveToClass="opacity-0 -scale-y-100">
<template v-if="empty">
<tr v-if="empty">
<tr>
<td class="text-5xl text-center p-4" colspan="1000">
<p class="lowercase first-letter:capitalize font-semibold">there are no data available</p>
</td>
@@ -150,13 +146,7 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</template>
<template v-else>
<template v-if="processing">
<tr v-for="i in Array(1).fill(0)" :key="i">
</tr>
</template>
<template v-else>
<tr v-for="(role, i) in data" :key="i" class="dark:hover:bg-gray-600 transition-all duration-300">
<tr v-for="(role, i) in data" :key="i" class="dark:hover:bg-gray-600 transition-all duration-300" :class="processing && 'bg-gray-800'">
<td class="px-2 py-1 border dark:border-gray-800 text-center">{{ i + 1 }}</td>
<td class="px-2 py-1 border dark:border-gray-800 uppercase">{{ role.name }}</td>
<td class="px-2 py-1 border dark:border-gray-800">
@@ -185,7 +175,6 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</td>
</tr>
</template>
</template>
</TransitionGroup>
</template>
</Builder>

View File

@@ -175,11 +175,7 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</template>
<template #tbody="{ data, processing, empty }">
<transition-group
enterActiveClass="transition-all duration-100"
leaveActiveClass="transition-all duration-50"
enterFromClass="opacity-0 -scale-y-100"
leaveToClass="opacity-0 -scale-y-100">
<TransitionGroup enterActiveClass="transition-all duration-200" leaveActiveClass="transition-all duration-200" enterFromClass="opacity-0 -scale-y-100" leaveToClass="opacity-0 -scale-y-100">
<template v-if="empty">
<tr v-if="empty">
<td class="text-5xl text-center p-4" colspan="1000">
@@ -189,16 +185,7 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</template>
<template v-else>
<template v-if="processing">
<tr v-for="i in Array(5).fill(0)" :key="i" class="border dark:border-gray-800">
<td class="text-5xl text-center p-2" colspan="1000">
<div class="lowercase first-letter:capitalize font-semibold dark:bg-gray-800 animate-pulse p-5 rounded-md"></div>
</td>
</tr>
</template>
<template v-else>
<tr v-for="(user, i) in data" :key="i" class="dark:hover:bg-gray-600 transition-all duration-300">
<tr v-for="(user, i) in data" :key="i" class="dark:hover:bg-gray-600 transition-all duration-300" :class="processing && 'bg-gray-800'">
<td class="px-2 py-1 border dark:border-gray-800 text-center">{{ i + 1 }}</td>
<td class="px-2 py-1 border dark:border-gray-800 uppercase">{{ user.name }}</td>
<td class="px-2 py-1 border dark:border-gray-800 uppercase">{{ user.username }}</td>
@@ -243,8 +230,7 @@ onUnmounted(() => window.removeEventListener('keydown', esc))
</td>
</tr>
</template>
</template>
</transition-group>
</TransitionGroup>
</template>
</Builder>
</div>