80 lines
1.3 KiB
Vue
80 lines
1.3 KiB
Vue
<template>
|
|
<div class="vertical-menu-item" :class="{ 'horizontal-item': settingsStore.layoutMode === 'top-bottom' }">
|
|
<div class="menu-icon-wrapper">
|
|
</div>
|
|
<span v-if="title" class="menu-title">{{ tMenu(title) }}</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useSettingsStore } from '@/stores/modules/settings'
|
|
import { tMenu } from '@/lang/index'
|
|
|
|
const settingsStore = useSettingsStore()
|
|
|
|
defineProps({
|
|
icon: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
title: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.vertical-menu-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 100%;
|
|
padding: 8px 0;
|
|
}
|
|
|
|
.horizontal-item {
|
|
padding: 10px;
|
|
|
|
.menu-icon-wrapper {
|
|
margin-bottom: 0;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.menu-title {
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
|
|
.menu-icon-wrapper {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.menu-icon {
|
|
font-size: 20px;
|
|
line-height: 1;
|
|
}
|
|
|
|
.menu-title {
|
|
font-size: 12px;
|
|
line-height: 1.2;
|
|
text-align: center;
|
|
word-break: break-all;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
max-width: 100%;
|
|
color: black;
|
|
}
|
|
|
|
.horizontal-item .menu-title {
|
|
color: white;
|
|
}
|
|
</style>
|