purityselect_admin/resources/js/layouts/blank.vue
2024-10-25 19:58:19 +05:00

44 lines
1.0 KiB
Vue
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
const { injectSkinClasses } = useSkins()
// This will inject classes in body tag for accurate styling
injectSkinClasses()
// SECTION: Loading Indicator
const isFallbackStateActive = ref(false)
const refLoadingIndicator = ref(null)
watch([
isFallbackStateActive,
refLoadingIndicator,
], () => {
if (isFallbackStateActive.value && refLoadingIndicator.value)
refLoadingIndicator.value.fallbackHandle()
if (!isFallbackStateActive.value && refLoadingIndicator.value)
refLoadingIndicator.value.resolveHandle()
}, { immediate: true })
// !SECTION
</script>
<template>
<AppLoadingIndicator ref="refLoadingIndicator" />
<div class="layout-wrapper layout-blank">
<RouterView #="{Component}">
<Suspense
:timeout="0"
@fallback="isFallbackStateActive = true"
@resolve="isFallbackStateActive = false"
>
<Component :is="Component" />
</Suspense>
</RouterView>
</div>
</template>
<style>
.layout-wrapper.layout-blank {
flex-direction: column;
}
</style>