Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
cb1ae34f
提交
cb1ae34f
authored
11月 12, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix notify type error
上级
d9b19600
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
35 行删除
+17
-35
MenuContent.tsx
src/components/Menu/src/MenuContent.tsx
+4
-5
useMessage.tsx
src/hooks/web/useMessage.tsx
+12
-29
index.ts
src/router/index.ts
+1
-1
没有找到文件。
src/components/Menu/src/MenuContent.tsx
浏览文件 @
cb1ae34f
...
@@ -40,8 +40,8 @@ export default defineComponent({
...
@@ -40,8 +40,8 @@ export default defineComponent({
}
}
function
renderTag
()
{
function
renderTag
()
{
const
{
item
,
showTitle
}
=
props
;
const
{
item
,
showTitle
,
isTop
}
=
props
;
if
(
!
item
||
showTitle
)
return
null
;
if
(
!
item
||
showTitle
||
isTop
)
return
null
;
const
{
tag
}
=
item
;
const
{
tag
}
=
item
;
if
(
!
tag
)
return
null
;
if
(
!
tag
)
return
null
;
...
@@ -60,16 +60,15 @@ export default defineComponent({
...
@@ -60,16 +60,15 @@ export default defineComponent({
if
(
!
props
.
item
)
{
if
(
!
props
.
item
)
{
return
null
;
return
null
;
}
}
const
{
showTitle
,
isTop
}
=
props
;
const
{
showTitle
}
=
props
;
const
{
name
,
icon
}
=
props
.
item
;
const
{
name
,
icon
}
=
props
.
item
;
const
searchValue
=
props
.
searchValue
||
''
;
const
searchValue
=
props
.
searchValue
||
''
;
const
index
=
name
.
indexOf
(
searchValue
);
const
index
=
name
.
indexOf
(
searchValue
);
const
beforeStr
=
name
.
substr
(
0
,
index
);
const
beforeStr
=
name
.
substr
(
0
,
index
);
const
afterStr
=
name
.
substr
(
index
+
searchValue
.
length
);
const
afterStr
=
name
.
substr
(
index
+
searchValue
.
length
);
le
t
cls
=
showTitle
?
[
'show-title'
]
:
[
'basic-menu__name'
];
cons
t
cls
=
showTitle
?
[
'show-title'
]
:
[
'basic-menu__name'
];
isTop
&&
!
showTitle
&&
(
cls
=
[]);
return
(
return
(
<>
<>
{
renderIcon
(
icon
!
)
}
{
renderIcon
(
icon
!
)
}
...
...
src/hooks/web/useMessage.tsx
浏览文件 @
cb1ae34f
import
type
{
ModalFunc
,
ModalFuncProps
}
from
'ant-design-vue/lib/modal/Modal'
;
import
type
{
ModalFunc
,
ModalFuncProps
}
from
'ant-design-vue/lib/modal/Modal'
;
import
type
{
MessageApi
}
from
'ant-design-vue/lib/message'
;
import
type
{
MessageApi
}
from
'ant-design-vue/lib/message'
;
import
type
{
VNodeTypes
,
CSSProperties
}
from
'vue'
;
import
{
Modal
,
message
as
Message
,
notification
}
from
'ant-design-vue'
;
import
{
Modal
,
message
as
Message
,
notification
}
from
'ant-design-vue'
;
import
{
InfoCircleFilled
,
CheckCircleFilled
,
CloseCircleFilled
}
from
'@ant-design/icons-vue'
;
import
{
InfoCircleFilled
,
CheckCircleFilled
,
CloseCircleFilled
}
from
'@ant-design/icons-vue'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
import
{
ArgsProps
,
ConfigProps
}
from
'ant-design-vue/lib/notification'
;
export
interface
ArgsProps
{
export
interface
NotifyApi
{
message
:
VNodeTypes
;
info
(
config
:
ArgsProps
):
void
;
description
?:
VNodeTypes
;
success
(
config
:
ArgsProps
):
void
;
btn
?:
VNodeTypes
;
error
(
config
:
ArgsProps
):
void
;
key
?:
string
;
warn
(
config
:
ArgsProps
):
void
;
onClose
?:
()
=>
void
;
warning
(
config
:
ArgsProps
):
void
;
duration
?:
number
|
null
;
open
(
args
:
ArgsProps
):
void
;
icon
?:
VNodeTypes
;
close
(
key
:
String
):
void
;
placement
?:
NotificationPlacement
;
config
(
options
:
ConfigProps
):
void
;
style
?:
CSSProperties
;
destroy
():
void
;
prefixCls
?:
string
;
class
?:
string
;
readonly
type
?:
IconType
;
onClick
?:
()
=>
void
;
top
?:
number
;
bottom
?:
number
;
getContainer
?:
()
=>
HTMLElement
;
closeIcon
?:
VNodeTypes
;
}
}
export
declare
type
NotificationPlacement
=
'topLeft'
|
'topRight'
|
'bottomLeft'
|
'bottomRight'
;
export
declare
type
NotificationPlacement
=
'topLeft'
|
'topRight'
|
'bottomLeft'
|
'bottomRight'
;
export
declare
type
IconType
=
'success'
|
'info'
|
'error'
|
'warning'
;
export
declare
type
IconType
=
'success'
|
'info'
|
'error'
|
'warning'
;
export
interface
ConfigProps
{
top
?:
string
|
number
;
bottom
?:
string
|
number
;
duration
?:
number
;
placement
?:
NotificationPlacement
;
getContainer
?:
()
=>
HTMLElement
;
closeIcon
?:
VNodeTypes
;
}
export
interface
ModalOptionsEx
extends
Omit
<
ModalFuncProps
,
'iconType'
>
{
export
interface
ModalOptionsEx
extends
Omit
<
ModalFuncProps
,
'iconType'
>
{
iconType
:
'warning'
|
'success'
|
'error'
|
'info'
;
iconType
:
'warning'
|
'success'
|
'error'
|
'info'
;
}
}
...
@@ -118,7 +101,7 @@ notification.config({
...
@@ -118,7 +101,7 @@ notification.config({
export
function
useMessage
()
{
export
function
useMessage
()
{
return
{
return
{
createMessage
:
Message
as
MessageApi
,
createMessage
:
Message
as
MessageApi
,
notification
:
notification
as
(
arg
:
ArgsProps
)
=>
void
,
notification
:
notification
as
NotifyApi
,
createConfirm
:
createConfirm
,
createConfirm
:
createConfirm
,
createSuccessModal
,
createSuccessModal
,
createErrorModal
,
createErrorModal
,
...
...
src/router/index.ts
浏览文件 @
cb1ae34f
...
@@ -37,7 +37,7 @@ export function resetRouter() {
...
@@ -37,7 +37,7 @@ export function resetRouter() {
router
.
getRoutes
().
forEach
((
route
)
=>
{
router
.
getRoutes
().
forEach
((
route
)
=>
{
const
{
name
}
=
route
;
const
{
name
}
=
route
;
if
(
name
&&
!
resetWhiteNameList
.
includes
(
name
as
string
))
{
if
(
name
&&
!
resetWhiteNameList
.
includes
(
name
as
string
))
{
router
.
removeRoute
(
name
);
router
.
hasRoute
(
name
)
&&
router
.
removeRoute
(
name
);
}
}
});
});
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论