modified: main_dc/BB/bbvue/src/App.vue
add profile icon into header, near hamburger menu
This commit is contained in:
@@ -19,12 +19,14 @@
|
|||||||
|
|
||||||
<!-- Используем компонент меню -->
|
<!-- Используем компонент меню -->
|
||||||
<div class="menu-box">
|
<div class="menu-box">
|
||||||
<div class="menu-box-item">
|
<!-- Отображение зависит от авторизации -->
|
||||||
<Icon icon="material-symbols:account-circle" class="profile-icon" />
|
<div class="menu-box-item" v-if="isAuthenticated">
|
||||||
|
<Icon icon="material-symbols:account-circle" class="profile-icon authed" />
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-box-item">
|
<div class="menu-box-item" v-else>
|
||||||
<Icon icon="material-symbols:no-accounts" class="profile-icon" />
|
<Icon icon="material-symbols:no-accounts" class="profile-icon nonAuthed" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="menu-box-item h-menu">
|
<div class="menu-box-item h-menu">
|
||||||
<NavigationMenu />
|
<NavigationMenu />
|
||||||
</div>
|
</div>
|
||||||
@@ -45,9 +47,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NavigationMenu from './components/NavigationMenu.vue'
|
import NavigationMenu from './components/NavigationMenu.vue'
|
||||||
import { Icon } from '@iconify/vue'
|
import { Icon } from '@iconify/vue'
|
||||||
|
import { useAuthStore } from '@/src/stores/auth' // Добавлен импорт
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
@@ -61,6 +65,13 @@ export default {
|
|||||||
headerVisible: false
|
headerVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// Получаем статус авторизации из стора
|
||||||
|
isAuthenticated() {
|
||||||
|
const authStore = useAuthStore()
|
||||||
|
return authStore.isAuthenticated
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleShowHeader() {
|
handleShowHeader() {
|
||||||
this.showHeader = true
|
this.showHeader = true
|
||||||
@@ -74,8 +85,8 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Остальные стили остаются без изменений */
|
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -90,13 +101,22 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.menu-box-item {
|
.menu-box-item {
|
||||||
|
height: fit-content;
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-icon {
|
.profile-icon {
|
||||||
color: rgb(30, 255, 0);
|
color: rgb(30, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-menu {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|||||||
Reference in New Issue
Block a user