1
0

left2Other.jsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import React, { PureComponent, useState } from 'react';
  2. import { Tooltip, Button, Popover } from '@douyinfe/semi-ui';
  3. import { PopupContent, Trigger } from './common';
  4. const Left2Right = () => {
  5. const [pos, setPos] = useState('left');
  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. top: 70
  26. }}
  27. >
  28. pos: {pos}
  29. </Trigger>
  30. </Tooltip>
  31. </div>);
  32. };
  33. const Left2RightTop = () => {
  34. const [pos, setPos] = useState('left');
  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. // right: 0,
  55. // top: 0
  56. // }}
  57. />
  58. </Tooltip>
  59. </div>);
  60. };
  61. const Left2RightBottom = () => {
  62. const [pos, setPos] = useState('left');
  63. return (<div
  64. style={{
  65. }}
  66. >
  67. <Tooltip
  68. content={
  69. <PopupContent
  70. w={200}
  71. h={200}
  72. />
  73. }
  74. arrowPointAtCenter={false}
  75. visible
  76. trigger='custom'
  77. position={pos}
  78. key={pos}
  79. >
  80. <Trigger
  81. w={100}
  82. h={100}
  83. style={{
  84. position: 'absolute',
  85. // right: 0,
  86. bottom: 0
  87. }}
  88. />
  89. </Tooltip>
  90. </div>);
  91. };
  92. const Left2LeftTop = () => {
  93. const [pos, setPos] = useState('left');
  94. return (<div
  95. style={{
  96. }}
  97. >
  98. <Tooltip
  99. content={
  100. <PopupContent
  101. w={200}
  102. h={200}
  103. />
  104. }
  105. arrowPointAtCenter={false}
  106. visible
  107. trigger='custom'
  108. position={pos}
  109. key={pos}
  110. >
  111. <Trigger
  112. w={100}
  113. h={100}
  114. style={{
  115. position: 'absolute',
  116. right: 0,
  117. top: 50
  118. }}
  119. />
  120. </Tooltip>
  121. </div>);
  122. };
  123. const Left2LeftBottom = () => {
  124. const [pos, setPos] = useState('left');
  125. return (<div
  126. style={{
  127. }}
  128. >
  129. <Tooltip
  130. content={
  131. <PopupContent
  132. w={200}
  133. h={200}
  134. />
  135. }
  136. arrowPointAtCenter={false}
  137. visible
  138. trigger='custom'
  139. position={pos}
  140. key={pos}
  141. >
  142. <Trigger
  143. w={100}
  144. h={100}
  145. style={{
  146. position: 'absolute',
  147. right: 0,
  148. bottom: 0
  149. }}
  150. />
  151. </Tooltip>
  152. </div>);
  153. };
  154. export { Left2Right, Left2RightTop, Left2RightBottom, Left2LeftTop, Left2LeftBottom };