1
1
import * as React from 'react' ;
2
2
import { storiesOf } from '@storybook/react' ;
3
3
import { withKnobs } from '@storybook/addon-knobs' ;
4
- import { propsTable } from '../common/propsTable' ;
5
-
4
+ import { Select , Option } from 'mo/components/select' ;
6
5
import { useContextView } from 'mo/components/contextview' ;
6
+ import { Menu , MenuMode , MenuItem , SubMenu } from 'mo/components/menu' ;
7
+
8
+ import { propsTable } from '../common/propsTable' ;
7
9
8
10
const stories = storiesOf ( 'ContextView' , module ) ;
9
11
stories . addDecorator ( withKnobs ) ;
@@ -48,8 +50,6 @@ stories.add(
48
50
position : 'relative' ,
49
51
width : 200 ,
50
52
height : 200 ,
51
- top : 0 ,
52
- left : 0 ,
53
53
margin : 'auto' ,
54
54
background : '#dddddd' ,
55
55
} ;
@@ -61,10 +61,44 @@ stories.add(
61
61
ContextView
62
62
组件主要是提供了一个可根据指定锚点位置、渲染内容的视图容器。
63
63
</ p >
64
- < h2 > 使用示例</ h2 >
64
+ < h2 > 使用示例 - 1 </ h2 >
65
65
< div id = "topLeft" onClick = { show } style = { styled } >
66
66
Click me!
67
67
</ div >
68
+ < div >
69
+ < h2 > 使用示例 - 2</ h2 >
70
+ < Select
71
+ id = "demo2"
72
+ key = "demo2"
73
+ style = { {
74
+ width : 200 ,
75
+ color : 'rgba(255, 255, 255, 0.4)' ,
76
+ background : '#252526' ,
77
+ } }
78
+ placeholder = "请选择"
79
+ >
80
+ < Option value = "1" > option - 1</ Option >
81
+ < Option value = "2" > option - 2</ Option >
82
+ < Option value = "3" > option - 3</ Option >
83
+ < Option value = "4" description = "Test option one" >
84
+ option - 4
85
+ </ Option >
86
+ </ Select >
87
+ </ div >
88
+ < div >
89
+ < h2 > 使用示例 - 3</ h2 >
90
+ < Menu style = { { width : 200 } } >
91
+ < MenuItem > menuItem1</ MenuItem >
92
+ < MenuItem > menuItem2</ MenuItem >
93
+ < MenuItem > menuItem3</ MenuItem >
94
+ < SubMenu mode = { MenuMode . Vertical } name = { 'menuItem4' } >
95
+ < MenuItem > subMenuItem1</ MenuItem >
96
+ < MenuItem > subMenuItem2</ MenuItem >
97
+ < MenuItem > subMenuItem3</ MenuItem >
98
+ < MenuItem > subMenuItem4</ MenuItem >
99
+ </ SubMenu >
100
+ </ Menu >
101
+ </ div >
68
102
</ div >
69
103
) ;
70
104
} ,
0 commit comments