| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- import React, { PureComponent, useState } from 'react';
- import { Tooltip, Button, Popover } from '@douyinfe/semi-ui';
- import { PopupContent, Trigger } from './common';
- const Top2Bottom = () => {
- const [pos, setPos] = useState('top');
- return (<div>
- <Tooltip
- content={
- <PopupContent
- w={200}
- h={200}
- />
- }
- arrowPointAtCenter={false}
- visible
- trigger='custom'
- position={pos}
- key={pos}
- >
- <Trigger
- w={100}
- h={100}
- style={{
- position: 'absolute',
- left: 300,
- }}
- >
- pos: {pos}
- </Trigger>
- </Tooltip>
- </div>);
- };
- const Top2BottomLeft = () => {
- const [pos, setPos] = useState('top');
- return (<div>
- <Tooltip
- content={
- <PopupContent
- w={200}
- h={200}
- />
- }
- arrowPointAtCenter={false}
- visible
- trigger='custom'
- position={pos}
- key={pos}
- >
- <Trigger
- w={100}
- h={100}
- style={{
- position: 'absolute',
- left: 40,
- }}
- />
- </Tooltip>
- </div>);
- };
- const Top2BottomRight = () => {
- const [pos, setPos] = useState('top');
- return (<div
- style={{
- }}
- >
- <Tooltip
- content={
- <PopupContent
- w={200}
- h={200}
- />
- }
- arrowPointAtCenter={false}
- visible
- trigger='custom'
- position={pos}
- key={pos}
- >
- <Trigger
- w={100}
- h={100}
- style={{
- position: 'absolute',
- right: 40,
- }}
- />
- </Tooltip>
- </div>);
- };
- const Top2TopLeft = () => {
- const [pos, setPos] = useState('top');
- return (<div
- style={{
- }}
- >
- <Tooltip
- content={
- <PopupContent
- w={200}
- h={200}
- />
- }
- arrowPointAtCenter={false}
- visible
- trigger='custom'
- position={pos}
- key={pos}
- >
- <Trigger
- w={100}
- h={100}
- style={{
- position: 'absolute',
- bottom: 0,
- }}
- />
- </Tooltip>
- </div>);
- };
- const Top2TopRight = () => {
- const [pos, setPos] = useState('top');
- return (<div
- style={{
- }}
- >
- <Tooltip
- content={
- <PopupContent
- w={200}
- h={200}
- />
- }
- arrowPointAtCenter={false}
- visible
- trigger='custom'
- position={pos}
- key={pos}
- >
- <Trigger
- w={100}
- h={100}
- style={{
- position: 'absolute',
- top: 224,
- right: 0
- }}
- />
- </Tooltip>
- </div>);
- };
- export { Top2Bottom, Top2BottomLeft, Top2BottomRight, Top2TopLeft, Top2TopRight };
|