top2Other.jsx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. import React, { PureComponent, useState } from 'react';
  2. import { Tooltip, Button, Popover } from '@douyinfe/semi-ui';
  3. import { PopupContent, Trigger } from './common';
  4. const Top2Bottom = () => {
  5. const [pos, setPos] = useState('top');
  6. return (<div>
  7. <Tooltip
  8. content={
  9. <PopupContent
  10. w={200}
  11. h={200}
  12. />
  13. }
  14. arrowPointAtCenter={false}
  15. visible
  16. trigger='custom'
  17. position={pos}
  18. key={pos}
  19. >
  20. <Trigger
  21. w={100}
  22. h={100}
  23. style={{
  24. position: 'absolute',
  25. left: 300,
  26. }}
  27. >
  28. pos: {pos}
  29. </Trigger>
  30. </Tooltip>
  31. </div>);
  32. };
  33. const Top2BottomLeft = () => {
  34. const [pos, setPos] = useState('top');
  35. return (<div>
  36. <Tooltip
  37. content={
  38. <PopupContent
  39. w={200}
  40. h={200}
  41. />
  42. }
  43. arrowPointAtCenter={false}
  44. visible
  45. trigger='custom'
  46. position={pos}
  47. key={pos}
  48. >
  49. <Trigger
  50. w={100}
  51. h={100}
  52. style={{
  53. position: 'absolute',
  54. left: 40,
  55. }}
  56. />
  57. </Tooltip>
  58. </div>);
  59. };
  60. const Top2BottomRight = () => {
  61. const [pos, setPos] = useState('top');
  62. return (<div
  63. style={{
  64. }}
  65. >
  66. <Tooltip
  67. content={
  68. <PopupContent
  69. w={200}
  70. h={200}
  71. />
  72. }
  73. arrowPointAtCenter={false}
  74. visible
  75. trigger='custom'
  76. position={pos}
  77. key={pos}
  78. >
  79. <Trigger
  80. w={100}
  81. h={100}
  82. style={{
  83. position: 'absolute',
  84. right: 40,
  85. }}
  86. />
  87. </Tooltip>
  88. </div>);
  89. };
  90. const Top2TopLeft = () => {
  91. const [pos, setPos] = useState('top');
  92. return (<div
  93. style={{
  94. }}
  95. >
  96. <Tooltip
  97. content={
  98. <PopupContent
  99. w={200}
  100. h={200}
  101. />
  102. }
  103. arrowPointAtCenter={false}
  104. visible
  105. trigger='custom'
  106. position={pos}
  107. key={pos}
  108. >
  109. <Trigger
  110. w={100}
  111. h={100}
  112. style={{
  113. position: 'absolute',
  114. bottom: 0,
  115. }}
  116. />
  117. </Tooltip>
  118. </div>);
  119. };
  120. const Top2TopRight = () => {
  121. const [pos, setPos] = useState('top');
  122. return (<div
  123. style={{
  124. }}
  125. >
  126. <Tooltip
  127. content={
  128. <PopupContent
  129. w={200}
  130. h={200}
  131. />
  132. }
  133. arrowPointAtCenter={false}
  134. visible
  135. trigger='custom'
  136. position={pos}
  137. key={pos}
  138. >
  139. <Trigger
  140. w={100}
  141. h={100}
  142. style={{
  143. position: 'absolute',
  144. top: 224,
  145. right: 0
  146. }}
  147. />
  148. </Tooltip>
  149. </div>);
  150. };
  151. export { Top2Bottom, Top2BottomLeft, Top2BottomRight, Top2TopLeft, Top2TopRight };