rwd menu修改

This commit is contained in:
koko 2024-11-06 09:59:21 +08:00
parent bba1b2892e
commit b6890e8311
5 changed files with 42 additions and 42 deletions

View File

@ -16,7 +16,7 @@ const toggleErrIcon = () => {
<!-- Page content here --> <!-- Page content here -->
<label <label
for="alarm" for="alarm"
class="drawer-button flex flex-col justify-center items-center btn-group" class="drawer-button flex flex-col justify-center items-center bg-transparent w-[95px]"
@click="toggleErrIcon" @click="toggleErrIcon"
> >
<font-awesome-icon <font-awesome-icon
@ -31,7 +31,7 @@ const toggleErrIcon = () => {
size="2x" size="2x"
class="text-white w-10 m-auto" class="text-white w-10 m-auto"
/> />
<span class="text-white"> {{ $t("alarm.title") }}</span> <span class="text-white block mt-0"> {{ $t("alarm.title") }}</span>
</label> </label>
</div> </div>
<div <div

View File

@ -67,7 +67,7 @@ const src = import.meta.env.MODE === "production" ? "./logo.svg" : Logo;
<NavbarItem /> <NavbarItem />
</div> </div>
<div class="navbar-end mr-4"> <div class="navbar-end mr-4">
<ul class="menu-box"> <ul class="left-menu">
<li> <li>
<NavbarLang /> <NavbarLang />
</li> </li>
@ -112,39 +112,17 @@ const src = import.meta.env.MODE === "production" ? "./logo.svg" : Logo;
.sub-drawer { .sub-drawer {
@apply bg-dark bg-opacity-90 shadow-xl !important; @apply bg-dark bg-opacity-90 shadow-xl !important;
} }
/**menu**/
.menu-box { .left-menu {
@apply flex flex-wrap justify-center ; @apply flex flex-wrap justify-center relative z-0;
position: relative;
z-index: 0;
} }
.menu-box .btn-group { .left-menu > li {
background: transparent; @apply relative;
width: 95px;
} }
.menu-box > li { .left-menu > li:not(:last-child)::after {
position: relative; @apply absolute top-5 bottom-0 left-20 right-0 block w-6 h-0.5 bg-[#93c0dc] z-0;
}
.menu-box > li:not(:last-child)::after {
content: ""; content: "";
position: absolute;
top: 20px;
bottom: 0;
left: 84px;
right: 0px;
display: block;
width: 25px;
height: 2px;
background-color: #93c0dc;
z-index: 0;
}
.menu-box .btn-group span {
color: #fff;
display: block;
margin-top: 0px;
} }
</style> </style>

View File

@ -22,7 +22,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="dropdown dropdown-bottom"> <div class="dropdown dropdown-bottom ">
<div <div
tabindex="0" tabindex="0"
role="button" role="button"

View File

@ -76,14 +76,14 @@ onMounted(() => {
<li class="flex flex-col items-center justify-center"> <li class="flex flex-col items-center justify-center">
<router-link <router-link
:to="{ name: 'dashboard' }" :to="{ name: 'dashboard' }"
class="flex flex-col justify-center items-center btn-group text-white" class="flex lg:flex-col justify-center items-center btn-group text-white"
> >
<font-awesome-icon <font-awesome-icon
:icon="['fas', 'home']" :icon="['fas', 'home']"
size="2x" size="2x"
class="w-10 m-auto" class="w-10 m-auto"
/> />
{{ $t("home") }} <span>{{ $t("home") }}</span>
</router-link> </router-link>
</li> </li>
<li <li
@ -95,7 +95,7 @@ onMounted(() => {
@click="showDrawer" @click="showDrawer"
:class=" :class="
twMerge( twMerge(
'flex flex-col justify-center items-center btn-group text-white cursor-pointer', 'flex lg:flex-col justify-center items-center btn-group text-white cursor-pointer',
route.fullPath.includes('/system') route.fullPath.includes('/system')
? 'router-link-active router-link-exact-active' ? 'router-link-active router-link-exact-active'
: '' : ''
@ -107,20 +107,20 @@ onMounted(() => {
size="2x" size="2x"
class="w-10 m-auto" class="w-10 m-auto"
/> />
{{ page.subName }} <span>{{ page.subName }}</span>
</a> </a>
<router-link <router-link
v-else v-else
:to="page.navigate" :to="page.navigate"
type="link" type="link"
class="flex flex-col justify-center items-center btn-group text-white" class="flex lg:flex-col justify-center items-center btn-group text-white"
> >
<font-awesome-icon <font-awesome-icon
:icon="['fas', page.icon]" :icon="['fas', page.icon]"
size="2x" size="2x"
class="w-10 m-auto" class="w-10 m-auto"
/> />
{{ page.subName }} <span>{{ page.subName }}</span>
</router-link> </router-link>
</li> </li>
</ul> </ul>
@ -169,8 +169,30 @@ onMounted(() => {
</a-drawer> </a-drawer>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
/**menu**/
.menu-box {
@apply flex flex-wrap lg:flex-row flex-col items-start lg:justify-center relative z-0 h-[100vh] lg:h-full w-60 lg:w-auto;
}
.menu-box .btn-group {
@apply bg-transparent lg:w-[95px] w-full mb-5 lg:mb-0;
}
.menu-box .btn-group span{
@apply text-2xl ms-2 lg:ms-0 lg:text-sm;
}
.menu-box > li {
@apply relative;
}
.menu-box > li:not(:last-child)::after {
@apply absolute top-5 bottom-0 left-20 right-0 lg:block hidden w-6 h-0.5 bg-[#93c0dc] z-0;
content: "";
}
.router-link-active.router-link-exact-active { .router-link-active.router-link-exact-active {
color: #93c0dc; @apply text-[#93c0dc];
} }
:deep(.ant-menu-submenu-selected) { :deep(.ant-menu-submenu-selected) {

View File

@ -15,14 +15,14 @@ const toggleLanguage = (lang) => {
<button <button
tabindex="0" tabindex="0"
type="button" type="button"
class="flex flex-col justify-center items-center btn-group" class="flex flex-col justify-center items-center bg-transparent w-[95px]"
> >
<font-awesome-icon <font-awesome-icon
:icon="['fas', 'globe']" :icon="['fas', 'globe']"
size="2x" size="2x"
class="text-white w-10 m-auto" class="text-white w-10 m-auto"
/> />
<span class="text-white">{{ $t("language") }}</span> <span class="text-white block mt-0">{{ $t("language") }}</span>
</button> </button>
<ul <ul
tabindex="0" tabindex="0"