Files
Cloud-Blog/components/category/topic.vue
nurRiyad 5b9032cf68 add function
Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
2023-01-09 23:39:02 +06:00

23 lines
573 B
Vue

<script setup lang="ts">
const route = useRoute()
// The the category name and make the first char upper
const category = computed(() => {
const name = route.params.category || ''
const firstChar = name.at(0)?.toLocaleUpperCase() || ''
const otherChar = name.slice(1)
return firstChar + otherChar
})
</script>
<template>
<div class="container mx-auto">
<div class="p-6 my-4 mx-3 rounded-md bg-gray-200">
<h1 class="text-black font-semibold leading-tight text-4xl md:text-5xl my-5">
#{{ category }}
</h1>
</div>
</div>
</template>