-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflex.go
40 lines (34 loc) · 838 Bytes
/
flex.go
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
package amis
// 布局
func Flex(opts ...opt) map[string]interface{} {
return newCompent("flex", opts...)
}
// css 类名
func Flex_className(p string) opt {
return func(o map[string]interface{}) {
o["className"] = p
}
}
// "start", "flex-start", "center", "end", "flex-end", "space-around", "space-between", "space-evenly"
func Flex_justify(p string) opt {
return func(o map[string]interface{}) {
o["justify"] = p
}
}
// "stretch", "start", "flex-start", "flex-end", "end", "center", "baseline"
func Flex_alignItems(p string) opt {
return func(o map[string]interface{}) {
o["alignItems"] = p
}
}
// 自定义样式
func Flex_style(p interface{}) opt {
return func(o map[string]interface{}) {
o["style"] = p
}
}
func Flex_items(p ...interface{}) opt {
return func(o map[string]interface{}) {
o["items"] = p
}
}