66 lines
1.3 KiB
Vue
66 lines
1.3 KiB
Vue
<template>
|
|
<button
|
|
type="button"
|
|
class="desktop-nav-item"
|
|
:class="{ 'desktop-nav-item--active': active }"
|
|
@click="$emit('click')"
|
|
>
|
|
<span class="desktop-nav-item__icon-wrap">
|
|
<img
|
|
v-if="iconSrc"
|
|
:src="iconSrc"
|
|
alt=""
|
|
class="desktop-nav-item__icon desktop-nav-item__icon--image"
|
|
/>
|
|
<BasicIcon v-else :icon="icon" size="20" class="desktop-nav-item__icon" />
|
|
<span v-if="badgeCount && badgeCount > 0" class="desktop-nav-item__badge">{{ badgeCount }}</span>
|
|
</span>
|
|
<span class="desktop-nav-item__label">{{ label }}</span>
|
|
</button>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
|
|
|
defineProps<{
|
|
icon: string
|
|
iconSrc?: string
|
|
label: string
|
|
active: boolean
|
|
badgeCount?: number
|
|
}>()
|
|
|
|
defineEmits<{
|
|
click: []
|
|
}>()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.desktop-nav-item__icon-wrap {
|
|
position: relative;
|
|
}
|
|
|
|
.desktop-nav-item__badge {
|
|
position: absolute;
|
|
top: -4px;
|
|
left: -4px;
|
|
min-width: 18px;
|
|
height: 18px;
|
|
padding: 0 4px;
|
|
border-radius: 999px;
|
|
background: var(--app-primary-color, #a72b77);
|
|
color: #fff;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
line-height: 18px;
|
|
text-align: center;
|
|
}
|
|
|
|
.desktop-nav-item__icon--image {
|
|
width: 32px;
|
|
height: 32px;
|
|
object-fit: contain;
|
|
transform: scale(1.75);
|
|
}
|
|
</style>
|