Skip to content

Commit 2b78f38

Browse files
committedMar 23, 2025·
更新TagPopup组件的dropdownRender函数签名,增加props参数以支持更灵活的渲染逻辑
1 parent 65a6c97 commit 2b78f38

File tree

1 file changed

+5
-2
lines changed
  • src/MarkdownEditor/editor/elements/code/TagPopup

1 file changed

+5
-2
lines changed
 

‎src/MarkdownEditor/editor/elements/code/TagPopup/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export type TagPopupProps = {
1010
onClick?: (v: string) => void;
1111
}>;
1212
prefixCls?: string;
13-
dropdownRender?: (defaultdom: ReactNode) => React.ReactNode;
13+
dropdownRender?: (
14+
defaultNode: ReactNode,
15+
props: TagPopupProps,
16+
) => React.ReactNode;
1417
dropdownStyle?: React.CSSProperties;
1518
menu?: MenuProps;
1619
notFoundContent?: React.ReactNode;
@@ -63,7 +66,7 @@ export const TagPopup = (
6366
autoFocus={true}
6467
dropdownRender={(defaultDropdownContent) => {
6568
if (dropdownRender) {
66-
return dropdownRender(defaultDropdownContent);
69+
return dropdownRender(defaultDropdownContent, props);
6770
} else if (menu! && items!) {
6871
return notFoundContent || '';
6972
} else {

1 commit comments

Comments
 (1)
Please sign in to comment.