Update nuxt to version 4 (#92)
* Nuxt 3.17.4 and other dependencies updated * Temporary fix (maybe) of the Inline Code * Update nuxt to version 4
This commit is contained in:
25
app/components/category/topic.vue
Normal file
25
app/components/category/topic.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { makeFirstCharUpper } from '@/utils/helper'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
// take category from route params & make first char upper
|
||||
const category = computed(() => {
|
||||
const name = route.params.category || ''
|
||||
let strName = ''
|
||||
|
||||
if (Array.isArray(name)) strName = name.at(0) || ''
|
||||
else strName = name
|
||||
return makeFirstCharUpper(strName)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container mx-auto">
|
||||
<div class="p-6 my-4 mx-2 rounded-md bg-gray-200 dark:bg-slate-900">
|
||||
<h1 class="text-black dark:text-white font-semibold leading-tight text-xl md:text-2xl">
|
||||
#{{ category }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user