Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kadycui
game-admin
提交
74431d3a
game-admin
项目概览
kadycui
/
game-admin
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
game-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
74431d3a
编写于
8月 31, 2023
作者:
kadycui
💻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ADD: 菜单折叠
上级
26f37d98
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
7 deletion
+37
-7
src/layouts/components/FHeader.vue
src/layouts/components/FHeader.vue
+3
-2
src/layouts/components/FMenu.vue
src/layouts/components/FMenu.vue
+23
-4
src/store/index.js
src/store/index.js
+11
-1
未找到文件。
src/layouts/components/FHeader.vue
浏览文件 @
74431d3a
...
...
@@ -7,8 +7,9 @@
GameAdmin
</span>
<el-icon
class=
"icon-btn"
>
<Fold
/>
<el-icon
class=
"icon-btn"
@
click=
"$store.commit('handleAsideWidth')"
>
<Fold
v-if=
"$store.state.asideWidth == '250px'"
/>
<Expand
v-else
/>
</el-icon>
<el-tooltip
effect=
"dark"
content=
"刷新"
placement=
"bottom"
>
<el-icon
class=
"icon-btn"
@
click=
"handleRefresh"
>
...
...
src/layouts/components/FMenu.vue
浏览文件 @
74431d3a
<
template
>
<div
class=
"f-menu"
>
<el-menu
default-active=
"2"
class=
"border-0"
@
select=
"handelSelect"
>
<div
class=
"f-menu"
:style=
"
{ width:$store.state.asideWidth }" >
<el-menu
default-active=
"2"
class=
"border-0"
@
select=
"handelSelect"
:collapse=
"iscollapse"
:collapse-transition=
"false"
>
<template
v-for=
"(item, index) in asideMenus"
:key=
"index"
>
<el-sub-menu
v-if=
"item.child && item.child.length > 0"
:index=
"item.name"
>
<template
#title
>
...
...
@@ -29,9 +35,21 @@
</template>
<
script
setup
>
import
{
computed
}
from
'
vue
'
import
{
useRouter
}
from
'
vue-router
'
import
{
useStore
}
from
'
vuex
'
const
router
=
useRouter
()
const
store
=
useStore
()
// 是否折叠
const
iscollapse
=
computed
(()
=>
!
(
store
.
state
.
asideWidth
==
'
250px
'
))
const
asideMenus
=
[{
"
name
"
:
"
后台面板
"
,
...
...
@@ -61,11 +79,12 @@ const handelSelect =(e)=>{
<
style
>
.f-menu
{
width
:
250px
;
transition
:
all
0.2s
;
top
:
64px
;
bottom
:
0
;
left
:
0
;
overflow
:
auto
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
@apply
shadow-md
fixed
bg-light-50;
}
...
...
src/store/index.js
浏览文件 @
74431d3a
...
...
@@ -9,7 +9,10 @@ const store = createStore({
state
()
{
return
{
// 用户信息
user
:
{}
user
:
{},
// 侧边宽度
asideWidth
:
"
250px
"
}
},
...
...
@@ -17,7 +20,14 @@ const store = createStore({
// 记录用户信息
SET_USERINFO
(
state
,
user
)
{
state
.
user
=
user
},
// 展开/收起侧边
handleAsideWidth
(
state
){
state
.
asideWidth
=
state
.
asideWidth
==
"
250px
"
?
"
64px
"
:
"
250px
"
}
},
actions
:
{
// 登录
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录