Skip to content

Commit

Permalink
feat(a-button): 允许定义 DeleteLink 显示的文案
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Oct 30, 2022
1 parent 579a9c9 commit ac5932c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DeleteLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ const handleDelete = (message, href, onDelete, e) => {
});
};

const DeleteLink = ({message = '删除后将无法还原,确定删除?', href, onDelete, ...rest}) => {
const DeleteLink = ({message = '删除后将无法还原,确定删除?', href, onDelete, children, ...rest}) => {
return <Typography.Link type="danger" href="#" onClick={handleDelete.bind(this, message, href, onDelete)} {...rest}>
删除
{children || '删除'}
</Typography.Link>;
};

DeleteLink.propTypes = {
message: PropTypes.string,
href: PropTypes.string,
onDelete: PropTypes.func,
children: PropTypes.node,
};

export default DeleteLink;

0 comments on commit ac5932c

Please sign in to comment.