add empty card when data not available

Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
nurRiyad
2023-01-10 00:13:46 +06:00
parent 5b9032cf68
commit cdab5c90ea
13 changed files with 313 additions and 20 deletions

View File

@@ -1,13 +1,16 @@
<script setup lang="ts">
import { makeFirstCharUpper } from '@/utils/helper'
const route = useRoute()
// The the category name and make the first char upper
// take category from route params & make first char upper
const category = computed(() => {
const name = route.params.category || ''
const firstChar = name.at(0)?.toLocaleUpperCase() || ''
const otherChar = name.slice(1)
let name = route.params.category || ''
let strName = ''
return firstChar + otherChar
if (name instanceof Array) strName = name.at(0) || ''
else strName = name
return makeFirstCharUpper(strName)
})
</script>