72 lines
1.5 KiB
Vue
72 lines
1.5 KiB
Vue
<script lang="ts">
|
|
import { defineComponent, ref, inject } from "vue";
|
|
export default defineComponent({
|
|
name: "UserCompBox",
|
|
});
|
|
</script>
|
|
|
|
<script lang="ts" setup>
|
|
import { useMain } from "@/components/Base/Tools/UserBox/hooks/index.ts";
|
|
import Menus from "@/components/Base/Tools/Menus/index.vue";
|
|
import Icon from "@/components/Module/Icon/index.vue";
|
|
|
|
const { menus, operateMenus } = useMain();
|
|
|
|
const prefix = "_user-box";
|
|
</script>
|
|
|
|
<template>
|
|
<a-Dropdown>
|
|
<template #overlay>
|
|
<div :class="`${prefix}-drop`">
|
|
<div :class="`${prefix}-drop-row`">
|
|
<Menus :menus="menus" />
|
|
</div>
|
|
<div :class="`${prefix}-drop-row`">
|
|
<Menus :menus="operateMenus" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<button :class="`${prefix}-avator`">
|
|
<icon name="userLine" />
|
|
</button>
|
|
</a-Dropdown>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
$prefix: "_user-box";
|
|
|
|
.#{$prefix} {
|
|
&-avator {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
&:hover {
|
|
background-color: #333;
|
|
}
|
|
}
|
|
&-drop {
|
|
width: 200px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 10px;
|
|
border-radius: 6px;
|
|
background-color: #fff;
|
|
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.16);
|
|
&-row {
|
|
margin-bottom: 10px;
|
|
&:last-child {
|
|
padding-top: 10px;
|
|
margin-bottom: 0;
|
|
border-top: 1px solid #333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|