ff-admin/src/components/admin/RoutingLink.vue
2024-11-27 17:06:39 +01:00

36 lines
853 B
Vue

<template>
<RouterLink v-if="link" :to="link">
<p
class="cursor-pointer w-full px-2 py-3"
:class="active ? 'rounded-r-lg bg-red-200 border-l-4 border-l-primary' : 'pl-3 hover:bg-red-200 rounded-lg'"
>
{{ title }}
</p>
</RouterLink>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
import { mapState, mapActions } from "pinia";
import { useNavigationStore, type navigationLinkModel } from "@/stores/admin/navigation";
</script>
<script lang="ts">
export default defineComponent({
props: {
title: {
type: String,
default: "LINK",
},
link: {
type: Object as PropType<string | { name: string }>,
default: "/",
},
active: {
type: Boolean,
default: false,
},
},
});
</script>