Commit 40f76a60 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加点击编辑触发事件属性

parent 03f07c6d
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment