Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
shenshaokai
jinfa-platform
Commits
40f76a60
Commit
40f76a60
authored
Aug 09, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加点击编辑触发事件属性
parent
03f07c6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
index.tsx
...ents/AddressSelect/components/AddressRadioGroup/index.tsx
+8
-2
No files found.
src/components/AddressSelect/components/AddressRadioGroup/index.tsx
View file @
40f76a60
...
...
@@ -67,6 +67,10 @@ interface IProps {
* 是否默认选择 默认地址,是的话会触发 onChange value为默认地址,默认为false
*/
isDefaultAddress
?:
boolean
,
/**
* 点击编辑触发事件
*/
onClickEdit
?:
(
recordId
:
number
)
=>
void
,
}
const
AddressRadioGroup
:
React
.
FC
<
IProps
>
=
(
props
)
=>
{
...
...
@@ -74,6 +78,7 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
addressType
=
2
,
value
,
onChange
,
onClickEdit
,
isDefaultAddress
=
false
,
}
=
props
;
const
[
list
,
setList
]
=
useState
<
AddressValueType
[]
>
([]);
...
...
@@ -184,6 +189,7 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
const
handleEdit
=
(
e
:
React
.
MouseEvent
<
HTMLElement
,
MouseEvent
>
,
id
:
number
)
=>
{
e
.
stopPropagation
();
onClickEdit
?.(
id
);
};
const
handleDelete
=
(
e
:
React
.
MouseEvent
<
HTMLElement
,
MouseEvent
>
,
id
:
number
)
=>
{
...
...
@@ -276,13 +282,13 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
</
div
>
<
div
className=
{
styles
[
'addressList-item-right'
]
}
>
<
div
className=
{
styles
[
'addressList-item-actions'
]
}
>
{
/*
<Button
<
Button
type=
"text"
size=
"small"
onClick=
{
(
e
)
=>
handleEdit
(
e
,
item
.
value
)
}
>
编辑
</Button>
*/
}
</
Button
>
<
Button
type=
"text"
size=
"small"
...
...
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