AppNavbar.vue
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
<VaNavbar class="app-layout-navbar py-2 px-0">
<template #left>
<div class="left">
<Transition v-if="isMobile" name="icon-fade" mode="out-in">
<VaIcon
color="primary"
:name="isSidebarMinimized ? 'menu' : 'close'"
size="24px"
style="margin-top: 3px"
@click="isSidebarMinimized = !isSidebarMinimized"
/>
</Transition>
<RouterLink to="/" aria-label="Visit home page">
<VuesticLogo />
</RouterLink>
</div>
</template>
<template #right>
<AppNavbarActions class="app-navbar__actions" :is-mobile="isMobile" />
</template>
</VaNavbar>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useGlobalStore } from '../../stores/global-store'
import AppNavbarActions from './components/AppNavbarActions.vue'
import VuesticLogo from '../VuesticLogo.vue'
defineProps({
isMobile: { type: Boolean, default: false },
})
const GlobalStore = useGlobalStore()
const { isSidebarMinimized } = storeToRefs(GlobalStore)
</script>
<style lang="scss" scoped>
.va-navbar {
z-index: 2;
@media screen and (max-width: 950px) {
.left {
width: 100%;
}
.app-navbar__actions {
display: flex;
justify-content: space-between;
}
}
}
.left {
display: flex;
align-items: center;
margin-left: 1rem;
& > * {
margin-right: 1rem;
}
& > *:last-child {
margin-right: 0;
}
}
.icon-fade-enter-active,
.icon-fade-leave-active {
transition: transform 0.5s ease;
}
.icon-fade-enter,
.icon-fade-leave-to {
transform: scale(0.5);
}
</style>