index.jsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import { Tooltip, Button } from '../../../index';
  3. export default function Demo() {
  4. const containerId = 'scroll-container';
  5. return (
  6. <div>
  7. <div
  8. style={{
  9. width: 600,
  10. height: 600,
  11. backgroundColor: '#eee',
  12. overflow: 'auto',
  13. }}
  14. >
  15. <div
  16. style={{
  17. width: 1200,
  18. height: 1200,
  19. position: 'relative',
  20. display: 'flex',
  21. alignItems: 'center',
  22. justifyContent: 'center',
  23. }}
  24. id={containerId}
  25. >
  26. <Tooltip
  27. content={'1111111'}
  28. trigger={'click'}
  29. position={'topLeft'}
  30. getPopupContainer={() => document.getElementById(containerId)}
  31. >
  32. <Button icon={'edit'}>编辑</Button>
  33. </Tooltip>
  34. </div>
  35. </div>
  36. </div>
  37. );
  38. }