-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathmobile.tsx
68 lines (64 loc) · 1.3 KB
/
mobile.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import Trigger from '@rc-component/trigger';
import React from 'react';
import '../../assets/index.less';
const builtinPlacements = {
left: {
points: ['cr', 'cl'],
},
right: {
points: ['cl', 'cr'],
},
top: {
points: ['bc', 'tc'],
},
bottom: {
points: ['tc', 'bc'],
},
topLeft: {
points: ['bl', 'tl'],
},
topRight: {
points: ['br', 'tr'],
},
bottomRight: {
points: ['tr', 'br'],
},
bottomLeft: {
points: ['tl', 'bl'],
},
};
const Test = () => {
const [open1, setOpen1] = React.useState(false);
return (
<div style={{ margin: 200 }}>
<div>
<Trigger
popupPlacement="top"
action={['hover']}
builtinPlacements={builtinPlacements}
popupVisible={open1}
onOpenChange={setOpen1}
popup={
<div
style={{
background: '#FFF',
boxShadow: '0 0 3px red',
padding: 12,
}}
>
<h2>Hello World</h2>
</div>
}
mobile={{
mask: true,
motion: { motionName: 'raise' },
maskMotion: { motionName: 'fade' },
}}
>
<span>Click Me</span>
</Trigger>
</div>
</div>
);
};
export default Test;