forked from mirrors/homebox
labels create and get
This commit is contained in:
parent
f956ec8eb2
commit
8ece3bd7bf
24 changed files with 850 additions and 132 deletions
27
frontend/components/Label/Chip.vue
Normal file
27
frontend/components/Label/Chip.vue
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { Label } from '~~/lib/api/classes/labels';
|
||||
defineProps({
|
||||
label: {
|
||||
type: Object as () => Label,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const badge = ref(null);
|
||||
const isHover = useElementHover(badge);
|
||||
const { focused } = useFocus(badge);
|
||||
|
||||
const isActive = computed(() => isHover.value || focused.value);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NuxtLink ref="badge" :to="`/label/${label.id}`">
|
||||
<span class="badge badge-lg p-4">
|
||||
<label class="swap swap-rotate" :class="isActive ? 'swap-active' : ''">
|
||||
<Icon name="heroicons-arrow-right" class="mr-2 swap-on"></Icon>
|
||||
<Icon name="heroicons-tag" class="mr-2 swap-off"></Icon>
|
||||
</label>
|
||||
{{ label.name }}
|
||||
</span>
|
||||
</NuxtLink>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue