Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
ee1c3498
V
vue-vben-admin
项目概览
球球不吃虾
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ee1c3498
编写于
4月 08, 2021
作者:
V
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(menu): improve menu logic, fix #461
上级
780a8a67
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
66 addition
and
33 deletion
+66
-33
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
src/components/Application/src/AppDarkModeToggle.vue
src/components/Application/src/AppDarkModeToggle.vue
+16
-17
src/components/Icon/src/index.vue
src/components/Icon/src/index.vue
+1
-5
src/components/SimpleMenu/src/SimpleMenu.vue
src/components/SimpleMenu/src/SimpleMenu.vue
+12
-1
src/components/SimpleMenu/src/components/Menu.vue
src/components/SimpleMenu/src/components/Menu.vue
+9
-0
src/components/SimpleMenu/src/components/MenuItem.vue
src/components/SimpleMenu/src/components/MenuItem.vue
+7
-2
src/components/SimpleMenu/src/components/SubMenuItem.vue
src/components/SimpleMenu/src/components/SubMenuItem.vue
+10
-3
src/components/SimpleMenu/src/useOpenKeys.ts
src/components/SimpleMenu/src/useOpenKeys.ts
+1
-1
src/layouts/default/menu/index.vue
src/layouts/default/menu/index.vue
+2
-1
src/layouts/default/setting/SettingDrawer.tsx
src/layouts/default/setting/SettingDrawer.tsx
+1
-1
src/layouts/default/tabs/index.less
src/layouts/default/tabs/index.less
+1
-1
src/router/routes/modules/demo/charts.ts
src/router/routes/modules/demo/charts.ts
+1
-1
src/views/sys/login/Login.vue
src/views/sys/login/Login.vue
+4
-0
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
ee1c3498
...
...
@@ -3,6 +3,7 @@
### 🐛 Bug Fixes
-
登录页样式修复
-
修复菜单已知问题
## 2.2.0 (2021-04-06)
...
...
src/components/Application/src/AppDarkModeToggle.vue
浏览文件 @
ee1c3498
...
...
@@ -3,7 +3,6 @@
v-if=
"getShowDarkModeToggle"
:class=
"[
prefixCls,
`$
{prefixCls}--${size}`,
{
[`${prefixCls}--dark`]: isDark,
},
...
...
@@ -30,13 +29,13 @@
export
default
defineComponent
({
name
:
'
DarkModeToggle
'
,
components
:
{
SvgIcon
},
props
:
{
size
:
{
type
:
String
,
default
:
'
default
'
,
validate
:
(
val
)
=>
[
'
default
'
,
'
large
'
].
includes
(
val
),
},
},
//
props: {
//
size: {
//
type: String,
//
default: 'default',
//
validate: (val) => ['default', 'large'].includes(val),
//
},
//
},
setup
()
{
const
{
prefixCls
}
=
useDesign
(
'
dark-mode-toggle
'
);
const
{
getDarkMode
,
setDarkMode
,
getShowDarkModeToggle
}
=
useRootSetting
();
...
...
@@ -97,15 +96,15 @@
}
}
&--large {
width: 72
px;
height: 34px;
padding: 0 10px;
//
&--large {
// width: 70
px;
//
height: 34px;
//
padding: 0 10px;
.@{prefix-cls}-inner {
width: 26px;
height: 26px;
}
}
//
.@{prefix-cls}-inner {
//
width: 26px;
//
height: 26px;
//
}
//
}
}
</
style
>
src/components/Icon/src/index.vue
浏览文件 @
ee1c3498
...
...
@@ -24,8 +24,6 @@
import
Iconify
from
'
@purge-icons/generated
'
;
import
{
isString
}
from
'
/@/utils/is
'
;
import
{
propTypes
}
from
'
/@/utils/propTypes
'
;
import
{
useRootSetting
}
from
'
/@/hooks/setting/useRootSetting
'
;
import
{
ThemeEnum
}
from
'
/@/enums/appEnum
'
;
const
SVG_END_WITH_FLAG
=
'
|svg
'
;
export
default
defineComponent
({
...
...
@@ -46,8 +44,6 @@
setup
(
props
)
{
const
elRef
=
ref
<
ElRef
>
(
null
);
const
{
getDarkMode
}
=
useRootSetting
();
const
isSvgIcon
=
computed
(()
=>
props
.
icon
?.
endsWith
(
SVG_END_WITH_FLAG
));
const
getSvgIcon
=
computed
(()
=>
props
.
icon
.
replace
(
SVG_END_WITH_FLAG
,
''
));
const
getIconRef
=
computed
(()
=>
`
${
props
.
prefix
?
props
.
prefix
+
'
:
'
:
''
}${
props
.
icon
}
`
);
...
...
@@ -85,7 +81,7 @@
return
{
fontSize
:
`
${
fs
}
px`
,
color
:
color
||
(
unref
(
getDarkMode
)
===
ThemeEnum
.
DARK
?
'
#fff
'
:
'
#303133
'
)
,
color
:
color
,
display
:
'
inline-flex
'
,
};
}
...
...
src/components/SimpleMenu/src/SimpleMenu.vue
浏览文件 @
ee1c3498
<
template
>
<Menu
v-bind=
"getBindValues"
@
select=
"handleSelect"
:activeName=
"activeName"
:openNames=
"getOpenKeys"
:class=
"prefixCls"
:activeSubMenuNames=
"activeSubMenuNames"
@
select=
"handleSelect"
@
open-change=
"handleOpenChange"
>
<template
v-for=
"item in items"
:key=
"item.path"
>
<SimpleSubMenu
...
...
@@ -53,6 +54,7 @@
beforeClickFn
:
{
type
:
Function
as
PropType
<
(
key
:
string
)
=>
Promise
<
boolean
>>
,
},
isSplitMenu
:
propTypes
.
bool
,
},
emits
:
[
'
menuClick
'
],
setup
(
props
,
{
attrs
,
emit
})
{
...
...
@@ -94,6 +96,9 @@
watch
(
()
=>
props
.
items
,
()
=>
{
if
(
!
props
.
isSplitMenu
)
{
return
;
}
setOpenKeys
(
currentRoute
.
value
.
path
);
},
{
flush
:
'
post
'
}
...
...
@@ -135,11 +140,17 @@
menuState
.
activeName
=
key
;
}
function
handleOpenChange
(
v
)
{
console
.
log
(
'
======================
'
);
console
.
log
(
v
);
console
.
log
(
'
======================
'
);
}
return
{
prefixCls
,
getBindValues
,
handleSelect
,
getOpenKeys
,
handleOpenChange
,
...
toRefs
(
menuState
),
};
},
...
...
src/components/SimpleMenu/src/components/Menu.vue
浏览文件 @
ee1c3498
...
...
@@ -138,6 +138,15 @@
});
emit
(
'
select
'
,
name
);
});
rootMenuEmitter
.
on
(
'
open-name-change
'
,
({
name
,
opened
})
=>
{
if
(
opened
&&
!
openedNames
.
value
.
includes
(
name
))
{
openedNames
.
value
.
push
(
name
);
}
else
if
(
!
opened
)
{
const
index
=
openedNames
.
value
.
findIndex
((
item
)
=>
item
===
name
);
index
!==
-
1
&&
openedNames
.
value
.
splice
(
index
,
1
);
}
});
});
return
{
getClass
,
openedNames
};
...
...
src/components/SimpleMenu/src/components/MenuItem.vue
浏览文件 @
ee1c3498
...
...
@@ -66,11 +66,16 @@
function
handleClickItem
()
{
const
{
disabled
}
=
props
;
if
(
disabled
)
return
;
if
(
disabled
)
{
return
;
}
rootMenuEmitter
.
emit
(
'
on-menu-item-select
'
,
props
.
name
);
if
(
unref
(
getCollapse
))
return
;
if
(
unref
(
getCollapse
))
{
return
;
}
const
{
uidList
}
=
getParentList
();
rootMenuEmitter
.
emit
(
'
on-update-opened
'
,
{
opend
:
false
,
parent
:
instance
?.
parent
,
...
...
src/components/SimpleMenu/src/components/SubMenuItem.vue
浏览文件 @
ee1c3498
...
...
@@ -43,8 +43,9 @@
:class=
"`${prefixCls}-submenu-title-icon`"
/>
</div>
<
template
#content
>
<div
v-bind=
"getEvents(true)"
v-show=
"opened"
>
<!-- eslint-disable-next-line -->
<
template
#content
v-show=
"opened"
>
<div
v-bind=
"getEvents(true)"
>
<ul
:class=
"[prefixCls, `$
{prefixCls}-${getTheme}`, `${prefixCls}-popup`]">
<slot></slot>
</ul>
...
...
@@ -78,7 +79,7 @@
import
{
isBoolean
,
isObject
}
from
'
/@/utils/is
'
;
import
Mitt
from
'
/@/utils/mitt
'
;
const
DELAY
=
2
5
0
;
const
DELAY
=
2
0
0
;
export
default
defineComponent
({
name
:
'
SubMenu
'
,
components
:
{
...
...
@@ -189,6 +190,7 @@
const
{
disabled
}
=
props
;
if
(
disabled
||
unref
(
getCollapse
))
return
;
const
opened
=
state
.
opened
;
if
(
unref
(
getAccordion
))
{
const
{
uidList
}
=
getParentList
();
rootMenuEmitter
.
emit
(
'
on-update-opened
'
,
{
...
...
@@ -196,6 +198,11 @@
parent
:
instance
?.
parent
,
uidList
:
uidList
,
});
}
else
{
rootMenuEmitter
.
emit
(
'
open-name-change
'
,
{
name
:
props
.
name
,
opened
:
!
opened
,
});
}
state
.
opened
=
!
opened
;
}
...
...
src/components/SimpleMenu/src/useOpenKeys.ts
浏览文件 @
ee1c3498
...
...
@@ -8,7 +8,7 @@ import { uniq } from 'lodash-es';
import
{
getAllParentPath
}
from
'
/@/router/helper/menuHelper
'
;
import
{
useTimeoutFn
}
from
'
/@/hooks/core/useTimeout
'
;
import
{
useDebounce
}
from
'
../../..
/hooks/core/useDebounce
'
;
import
{
useDebounce
}
from
'
/@
/hooks/core/useDebounce
'
;
export
function
useOpenKeys
(
menuState
:
MenuState
,
...
...
src/layouts/default/menu/index.vue
浏览文件 @
ee1c3498
...
...
@@ -49,6 +49,7 @@
getAccordion
,
getIsHorizontal
,
getIsSidebarType
,
getSplit
,
}
=
useMenuSetting
();
const
{
getShowLogo
}
=
useRootSetting
();
...
...
@@ -144,7 +145,7 @@
// console.log(menus);
if
(
!
menus
||
!
menus
.
length
)
return
null
;
return
!
props
.
isHorizontal
?
(
<
SimpleMenu
{...
menuProps
}
items
=
{
menus
}
/
>
<
SimpleMenu
{...
menuProps
}
i
sSplitMenu
=
{
unref
(
getSplit
)}
i
tems
=
{
menus
}
/
>
)
:
(
<
BasicMenu
{...
menuProps
}
...
...
src/layouts/default/setting/SettingDrawer.tsx
浏览文件 @
ee1c3498
...
...
@@ -408,7 +408,7 @@ export default defineComponent({
wrapClassName
=
"setting-drawer"
>
{
unref
(
getShowDarkModeToggle
)
&&
<
Divider
>
{
()
=>
t
(
'
layout.setting.darkMode
'
)
}
</
Divider
>
}
{
unref
(
getShowDarkModeToggle
)
&&
<
AppDarkModeToggle
class
=
"mx-auto"
size
=
"large"
/>
}
{
unref
(
getShowDarkModeToggle
)
&&
<
AppDarkModeToggle
class
=
"mx-auto"
/>
}
<
Divider
>
{
()
=>
t
(
'
layout.setting.navMode
'
)
}
</
Divider
>
{
renderSidebar
()
}
<
Divider
>
{
()
=>
t
(
'
layout.setting.sysTheme
'
)
}
</
Divider
>
...
...
src/layouts/default/tabs/index.less
浏览文件 @
ee1c3498
...
...
@@ -82,7 +82,7 @@ html[data-theme='dark'] {
.ant-tabs-tab-active {
position: relative;
padding-left: 18px;
color: @white;
color: @white
!important
;
background: @primary-color;
border: 0;
transition: none;
...
...
src/router/routes/modules/demo/charts.ts
浏览文件 @
ee1c3498
...
...
@@ -7,7 +7,7 @@ const charts: AppRouteModule = {
path
:
'
/charts
'
,
name
:
'
Charts
'
,
component
:
LAYOUT
,
redirect
:
'
/charts/
apexChart
'
,
redirect
:
'
/charts/
echarts/map
'
,
meta
:
{
icon
:
'
ion:bar-chart-outline
'
,
title
:
t
(
'
routes.demo.charts.charts
'
),
...
...
src/views/sys/login/Login.vue
浏览文件 @
ee1c3498
...
...
@@ -112,6 +112,10 @@
&-form {
background: transparent !important;
}
.app-iconify {
color: #fff;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录