mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-06 20:37:32 +00:00
0a6bde8bc6
vue
35 lines
1.1 KiB
Vue
35 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { Link } from '@inertiajs/vue3';
|
|
|
|
defineProps<{
|
|
href?: string;
|
|
as?: string;
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<button
|
|
v-if="as == 'button'"
|
|
type="submit"
|
|
v-bind="$attrs"
|
|
class="block w-full px-4 py-2 text-start text-sm leading-5 text-text-primary hover:bg-card-background-active focus:outline-none focus:bg-card-background-active transition duration-150 ease-in-out">
|
|
<slot />
|
|
</button>
|
|
<a
|
|
v-else-if="as == 'a'"
|
|
:href="href"
|
|
class="block px-4 py-2 text-sm leading-5 text-text-primary hover:bg-card-background-active focus:outline-none focus:bg-card-background-active transition duration-150 ease-in-out">
|
|
<slot />
|
|
</a>
|
|
|
|
<Link
|
|
v-else
|
|
:href="href ?? ''"
|
|
prefetch
|
|
class="block px-4 py-2 text-sm leading-5 text-text-primary hover:bg-card-background-active focus:outline-none focus:bg-card-background-active transition duration-150 ease-in-out">
|
|
<slot />
|
|
</Link>
|
|
</div>
|
|
</template>
|