Add prettier config, format codebase

This commit is contained in:
David Haz
2025-07-12 11:59:33 +03:00
parent ac8b2c04d8
commit f4d97ee94e
211 changed files with 10586 additions and 8810 deletions

View File

@@ -7,6 +7,7 @@
<template #default>
<component :is="SubcategoryComponent" v-if="SubcategoryComponent" />
</template>
<template #fallback>
<div class="loading-placeholder"></div>
</template>
@@ -18,49 +19,53 @@
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted, nextTick, defineAsyncComponent } from 'vue'
import { useRoute } from 'vue-router'
import { componentMap } from '../constants/Components'
import { decodeLabel } from '../utils/utils'
import BackToTopButton from '@/components/common/BackToTopButton.vue'
import '../css/category.css'
import { ref, computed, watch, onMounted, nextTick, defineAsyncComponent } from 'vue';
import { useRoute } from 'vue-router';
import { componentMap } from '../constants/Components';
import { decodeLabel } from '../utils/utils';
import BackToTopButton from '@/components/common/BackToTopButton.vue';
import '../css/category.css';
const route = useRoute()
const scrollRef = ref<HTMLDivElement | null>(null)
const route = useRoute();
const scrollRef = ref<HTMLDivElement | null>(null);
const subcategory = computed(() => route.params.subcategory as string)
const decodedLabel = computed(() => decodeLabel(subcategory.value))
const subcategory = computed(() => route.params.subcategory as string);
const decodedLabel = computed(() => decodeLabel(subcategory.value));
const SubcategoryComponent = computed(() => {
if (!subcategory.value) {
return null
return null;
}
const componentLoader = componentMap[subcategory.value as keyof typeof componentMap]
const componentLoader = componentMap[subcategory.value as keyof typeof componentMap];
if (!componentLoader) {
return null
return null;
}
return defineAsyncComponent(componentLoader)
})
return defineAsyncComponent(componentLoader);
});
watch(decodedLabel, (newLabel) => {
if (newLabel) {
document.title = `Vue Bits - ${newLabel}`
}
}, { immediate: true })
watch(
decodedLabel,
newLabel => {
if (newLabel) {
document.title = `Vue Bits - ${newLabel}`;
}
},
{ immediate: true }
);
watch(subcategory, async () => {
if (scrollRef.value) {
await nextTick()
scrollRef.value.scrollTo(0, 0)
await nextTick();
scrollRef.value.scrollTo(0, 0);
}
})
});
onMounted(() => {
if (scrollRef.value) {
scrollRef.value.scrollTo(0, 0)
scrollRef.value.scrollTo(0, 0);
}
})
</script>
});
</script>