16 lines
349 B
Vue
16 lines
349 B
Vue
|
<template>
|
||
|
<RouterLink :to="props.path" :class="cssClass">
|
||
|
{{ props.name }}
|
||
|
</RouterLink>
|
||
|
</template>
|
||
|
|
||
|
<script setup lang="ts">
|
||
|
const props = defineProps<{
|
||
|
path: string;
|
||
|
name: string;
|
||
|
}>();
|
||
|
|
||
|
const route = useRoute();
|
||
|
const cssClass = computed((): string => (props.path === route.path ? 'bg-background-300' : 'bg-background'));
|
||
|
</script>
|