bottom2Other.jsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import React, { PureComponent, useState } from 'react';
  2. import { Tooltip, Button, Popover } from '@douyinfe/semi-ui';
  3. import { PopupContent, Trigger } from './common';
  4. const Bottom2Top = () => {
  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. bottom: 0,
  26. left: 100
  27. }}
  28. >
  29. pos: {pos}
  30. </Trigger>
  31. </Tooltip>
  32. </div>);
  33. };
  34. const Bottom2TopLeft = () => {
  35. const [pos, setPos] = useState('top');
  36. return (<div>
  37. <Tooltip
  38. content={
  39. <PopupContent
  40. w={200}
  41. h={200}
  42. />
  43. }
  44. arrowPointAtCenter={false}
  45. visible
  46. trigger='custom'
  47. position={pos}
  48. key={pos}
  49. >
  50. <Trigger
  51. w={100}
  52. h={100}
  53. style={{
  54. position: 'absolute',
  55. bottom: 0
  56. }}
  57. />
  58. </Tooltip>
  59. </div>);
  60. };
  61. const Bottom2TopRight = () => {
  62. const [pos, setPos] = useState('top');
  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: 40,
  86. bottom: 0
  87. }}
  88. />
  89. </Tooltip>
  90. </div>);
  91. };
  92. const Bottom2BottomLeft = () => {
  93. const [pos, setPos] = useState('top');
  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. left: 40
  117. }}
  118. />
  119. </Tooltip>
  120. </div>);
  121. };
  122. const Bottom2BottomRight = () => {
  123. const [pos, setPos] = useState('top');
  124. return (<div
  125. style={{
  126. }}
  127. >
  128. <Tooltip
  129. content={
  130. <PopupContent
  131. w={200}
  132. h={200}
  133. />
  134. }
  135. arrowPointAtCenter={false}
  136. visible
  137. trigger='custom'
  138. position={pos}
  139. key={pos}
  140. >
  141. <Trigger
  142. w={100}
  143. h={100}
  144. style={{
  145. position: 'absolute',
  146. right: 40
  147. }}
  148. />
  149. </Tooltip>
  150. </div>);
  151. };
  152. export { Bottom2Top, Bottom2TopLeft, Bottom2TopRight, Bottom2BottomLeft, Bottom2BottomRight };