File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : Mobile
3+ nav :
4+ title : Demo
5+ path : /demo
6+ ---
7+
8+ <code src =" ../examples/mobile.tsx " ></code >
Original file line number Diff line number Diff line change 1+ import Trigger from '@rc-component/trigger' ;
2+ import React from 'react' ;
3+ import '../../assets/index.less' ;
4+
5+ const builtinPlacements = {
6+ left : {
7+ points : [ 'cr' , 'cl' ] ,
8+ } ,
9+ right : {
10+ points : [ 'cl' , 'cr' ] ,
11+ } ,
12+ top : {
13+ points : [ 'bc' , 'tc' ] ,
14+ } ,
15+ bottom : {
16+ points : [ 'tc' , 'bc' ] ,
17+ } ,
18+ topLeft : {
19+ points : [ 'bl' , 'tl' ] ,
20+ } ,
21+ topRight : {
22+ points : [ 'br' , 'tr' ] ,
23+ } ,
24+ bottomRight : {
25+ points : [ 'tr' , 'br' ] ,
26+ } ,
27+ bottomLeft : {
28+ points : [ 'tl' , 'bl' ] ,
29+ } ,
30+ } ;
31+
32+ const Test = ( ) => {
33+ const [ open1 , setOpen1 ] = React . useState ( false ) ;
34+
35+ return (
36+ < div style = { { margin : 200 } } >
37+ < div >
38+ < Trigger
39+ popupPlacement = "right"
40+ action = { [ 'click' ] }
41+ builtinPlacements = { builtinPlacements }
42+ popupVisible = { open1 }
43+ onOpenChange = { setOpen1 }
44+ popup = {
45+ < div >
46+ < h2 > Hello World</ h2 >
47+ </ div >
48+ }
49+ mobile
50+ >
51+ < span > Click Me</ span >
52+ </ Trigger >
53+ </ div >
54+ </ div >
55+ ) ;
56+ } ;
57+
58+ export default Test ;
You can’t perform that action at this time.
0 commit comments