index.vue 2.34 KB
<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>