- 覆盖颗粒度只在 3 个入口: router targets / module routes / field registry - 框架内 .vue 之间互相引用全部硬编码静态 import,resolveVue/defineAsyncComponent 退出 .vue 文件 - 修 components/fields/FieldRelativeTime.vue 的 ../VueAdmin → ../../VueAdmin (移动后未跟改)
91 lines
1.7 KiB
Vue
91 lines
1.7 KiB
Vue
<template>
|
|
<div class="user-bar">
|
|
<LangSwitch class="panel-item" />
|
|
<div class="panel-item" @click="screen">
|
|
<el-icon><el-icon-full-screen /></el-icon>
|
|
</div>
|
|
<el-dropdown class="user" trigger="click" @command="handleUser">
|
|
<div class="user-avatar dropdown-panel-item">
|
|
<label>{{ vueAdmin.userName || 'Admin' }}</label>
|
|
<el-icon class="el-icon--right"><el-icon-arrow-down /></el-icon>
|
|
</div>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-item command="clearCache">{{ $t("base.clearCache") }}</el-dropdown-item>
|
|
<el-dropdown-item divided command="outLogin">{{ $t("base.logout") }}</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</template>
|
|
</el-dropdown>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { vueAdmin } from "../VueAdmin";
|
|
import LangSwitch from "./ShrimpLangSwitch.vue";
|
|
|
|
function screen() {
|
|
vueAdmin.fullscreen();
|
|
}
|
|
function handleUser(command: string) {
|
|
switch (command) {
|
|
case "clearCache":
|
|
vueAdmin.clearCache();
|
|
vueAdmin.reset();
|
|
break;
|
|
case "outLogin":
|
|
vueAdmin.reset();
|
|
break;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.user-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
height: 100%;
|
|
}
|
|
|
|
.user-bar .panel-item {
|
|
padding: 0 10px;
|
|
cursor: pointer;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.user-bar .panel-item i {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.user-bar .panel-item:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.dropdown-panel-item {
|
|
padding: 0 10px;
|
|
cursor: pointer;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.dropdown-panel-item:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.user-bar .user-avatar {
|
|
height: 49px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.user-bar .user-avatar label {
|
|
display: inline-block;
|
|
margin-left: 5px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
|