antd popover组件二次封装子元素children显示

import React, { PropsWithChildren } from 'react';
import './index.scss';
import { Popover } from 'antd';

export interface DictPopoverCompProps {
  open: boolean;
  keyWords: string;
}

// 词库联想气泡
const DictPopoverComp = (props: PropsWithChildren<DictPopoverCompProps>) => {
  const { open, children } = props;

  const onOpenChangeFn = () => {};
  return (
    <Popover
      className="DictPopoverComp"
      content={<div>111</div>}
      open={open}
      onOpenChange={onOpenChangeFn}
    >
      {children}
    </Popover>
  );
};
export default DictPopoverComp;

 

posted @ 2024-04-09 18:02  最好的年纪  阅读(39)  评论(0编辑  收藏  举报