index.vue
2.34 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
80
81
82
83
84
85
86
<template>
<section class="menu">
<div class="header">
<div class="header-tools">
<div class="logo">
<img :src="LOGO" width="141" @click="goViewerHome" />
</div>
<div class="header-content">
<slot name="content" />
</div>
</div>
<div class="user-info"><UserInfo /></div>
</div>
</section>
</template>
<script setup>
import LOGO from '@/assets/images/header/logo.png';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import UserInfo from '@/components/header-userInfo/user-info.vue';
const localitem = localStorage.getItem('language');
const local = localitem === null ? 'en' : localitem;
const { locale } = useI18n();
locale.value = local;
const router = useRouter();
const goViewerHome = () => {
router.push({ path: 'viewer' });
};
</script>
<style lang="less">
.menu {
.header {
z-index: 300;
display: flex;
position: fixed;
-webkit-box-pack: justify;
justify-content: space-between;
height: 44px;
-webkit-box-align: center;
align-items: center;
box-shadow: @color-split-line 0px 1px 0.5px 0px;
background-color: rgb(255, 255, 255);
color: rgb(51, 51, 51);
margin-bottom: 1px;
top: 0px;
left: 0px;
right: 0px;
.user-info {
width: 35%;
display: flex;
-webkit-box-pack: end;
justify-content: flex-end;
margin-right: 20px;
}
.header-tools {
height: 100%;
display: flex;
-webkit-box-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
align-items: center;
.logo {
min-width: 200px;
& img {
display: flex;
flex-direction: row;
gap: 8px;
-webkit-box-align: center;
align-items: center;
margin-left: 20px;
cursor: pointer;
}
}
.header-content {
display: flex;
margin-left: 1px;
gap: 4px;
}
}
}
}
</style>