feat: posts and mentions in profile (#17)

This commit is contained in:
patak 2022-11-20 22:38:52 +01:00 committed by GitHub
parent 2442c80bfb
commit 5d5cdebb56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 13 deletions

View file

@ -0,0 +1,21 @@
<script setup lang="ts">
defineProps<{
modelValue: string
options: string[]
}>()
defineEmits(['update:modelValue'])
function toValidName(otpion: string) {
return otpion.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
}
</script>
<template>
<div flex w-full>
<template v-for="option in options" :key="option">
<input
:id="`tab-${toValidName(option)}`" :checked="modelValue === option" :value="option" type="radio" name="tabs" display="none" @change="$emit('update:modelValue', option)"
><label flex w-full justify-center h-8 cursor-pointer :for="`tab-${toValidName(option)}`" :class="modelValue === option ? 'color-primary' : 'hover:color-purple'" tabindex="1" @keypress.enter="$emit('update:modelValue', option)">{{ option }}</label>
</template>
</div>
</template>