1.0.10 • Published 4 months ago

jxy-identity-popover v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Api

import {ERPAIIdentityPopover, type ERPAIIdentityPopoverRef,} from 'jxy-identity-popover';
 render: (args) => {
    const popoverRef = useRef<ERPAIIdentityPopoverRef>(null);

    const handleSelect = (result: any) => console.log('选中结果:', result);
    const handleClose = () => console.log('关闭弹层');
    const handleItemClick = (item: any) => console.log('点击结果项:', item);
    const handleIdentitySuccess = (result: any) => console.log('识别成功:', result);
    const handleIdentityFail = (error: any) => console.error('识别失败:', error);
    const handleLearnSuccess = (result: any) => console.log('学习成功:', result);
    const handleLearnFail = (error: any) => console.error('学习失败:', error);

    return (
      <div>
        <ERPAIIdentityPopover
        ref={popoverRef}
        onSelect={handleSelect}
        onClose={handleClose}
        onItemClick={handleItemClick}
        onIdentitySuccess={handleIdentitySuccess}
        onIdentityFail={handleIdentityFail}
        onLearnSuccess={handleLearnSuccess}
        onLearnFail={handleLearnFail}
      >
        <Button>打开完整功能弹层</Button>
      </ERPAIIdentityPopover>
      <Button onClick={() => popoverRef.current?.show()}>受控模式</Button>
      </div>
    );
  }