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
a6ef771f
Commit
a6ef771f
authored
Jun 24, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(pop-confirm): fix event working unexpected
parent
4d8e3985
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
Dropdown.vue
src/components/Dropdown/src/Dropdown.vue
+18
-3
No files found.
CHANGELOG.zh_CN.md
View file @
a6ef771f
...
...
@@ -4,6 +4,7 @@
-
**Table**
修复分页抖动问题
-
**Upload**
确保携带自定义参数
-
**Dropdown**
修复 popConfirm 的图标显示问题
## 2.5.0(2021-06-20)
...
...
src/components/Dropdown/src/Dropdown.vue
View file @
a6ef771f
...
...
@@ -11,7 +11,10 @@
@
click=
"handleClickMenu(item)"
:disabled=
"item.disabled"
>
<Popconfirm
v-if=
"popconfirm && item.popConfirm"
v-bind=
"omit(item.popConfirm, 'icon')"
>
<Popconfirm
v-if=
"popconfirm && item.popConfirm"
v-bind=
"getPopConfirmAttrs(item.popConfirm)"
>
<template
#icon
v-if=
"item.popConfirm.icon"
>
<Icon
:icon=
"item.popConfirm.icon"
/>
</
template
>
...
...
@@ -33,13 +36,14 @@
</template>
<
script
lang=
"ts"
>
import
type
{
PropType
}
from
'
vue
'
;
import
{
computed
,
PropType
}
from
'
vue
'
;
import
type
{
DropMenu
}
from
'
./typing
'
;
import
{
defineComponent
}
from
'
vue
'
;
import
{
Dropdown
,
Menu
,
Popconfirm
}
from
'
ant-design-vue
'
;
import
{
Icon
}
from
'
/@/components/Icon
'
;
import
{
omit
}
from
'
lodash-es
'
;
import
{
isFunction
}
from
'
/@/utils/is
'
;
export
default
defineComponent
({
name
:
'
BasicDropdown
'
,
...
...
@@ -82,9 +86,20 @@
item
.
onClick
?.();
}
const
getPopConfirmAttrs
=
computed
(()
=>
{
return
(
attrs
)
=>
{
const
originAttrs
=
omit
(
attrs
,
[
'
confirm
'
,
'
cancel
'
,
'
icon
'
]);
if
(
!
attrs
.
onConfirm
&&
attrs
.
confirm
&&
isFunction
(
attrs
.
confirm
))
originAttrs
[
'
onConfirm
'
]
=
attrs
.
confirm
;
if
(
!
attrs
.
onCancel
&&
attrs
.
cancel
&&
isFunction
(
attrs
.
cancel
))
originAttrs
[
'
onCancel
'
]
=
attrs
.
cancel
;
return
originAttrs
;
};
});
return
{
handleClickMenu
,
omit
,
getPopConfirmAttrs
,
getAttr
:
(
key
:
string
|
number
)
=>
({
key
}),
};
},
...
...
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