Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
154ebc3d
Commit
154ebc3d
authored
Jun 17, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(use-message): `content` not support vNode
修复封装的`useMessage`部分函数中`content`不支持vNode类型以及`createConfirm`不支持html的问题
parent
0acc4ab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
useMessage.tsx
src/hooks/web/useMessage.tsx
+7
-1
No files found.
src/hooks/web/useMessage.tsx
View file @
154ebc3d
...
...
@@ -5,6 +5,7 @@ import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-des
import
{
ArgsProps
,
ConfigProps
}
from
'
ant-design-vue/lib/notification
'
;
import
{
useI18n
}
from
'
./useI18n
'
;
import
{
isString
}
from
'
/@/utils/is
'
;
export
interface
NotifyApi
{
info
(
config
:
ArgsProps
):
void
;
...
...
@@ -46,7 +47,11 @@ function getIcon(iconType: string) {
}
function
renderContent
({
content
}:
Pick
<
ModalOptionsEx
,
'
content
'
>
)
{
return
<
div
innerHTML=
{
`<div>${content as string}</div>`
}
></
div
>;
if
(
isString
(
content
))
{
return
<
div
innerHTML=
{
`<div>${content as string}</div>`
}
></
div
>;
}
else
{
return
content
;
}
}
/**
...
...
@@ -59,6 +64,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
centered
:
true
,
icon
:
getIcon
(
iconType
),
...
options
,
content
:
renderContent
(
options
),
};
return
Modal
.
confirm
(
opt
)
as
unknown
as
ConfirmOptions
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment