Flex 弹性布局容器
#
使用场景基于 Flexbox 实现的弹性布局容器。响应式栅格支持基于屏幕宽度进行动态的布局,Flex 布局容器支持 12 栅格布局,支持借助栅格数实现基本的响应式布局能力。
#
示例#
基本用法1
2
3
inline
#
垂直布局1
2
3
inline
#
多列1/3
1/3
1/3
noInline
#
不同列宽1/12
1/6
1/4
1/2
noInline
#
自动列宽item
动态宽度的内容
item
noInline
#
响应式列宽responsive
item
item
noInline
#
API#
Flex字段 | 描述 |
---|---|
spacing | StringOrNumber 间距 |
direction | FlexDirection 子元素排列方向 |
align | AlignItems y 轴对齐方式 |
justify | JustifyContent x 轴对齐方式 |
wrap | FlexWrap |
basis | FlexBasis<Length> |
grow | FlexGrow |
shrink | FlexShrink |
as | any |
style | CSSProperties |
className | string |
m | StringOrNumber |
margin | StringOrNumber |
mt | StringOrNumber |
marginTop | StringOrNumber |
mr | StringOrNumber |
marginRight | StringOrNumber |
mb | StringOrNumber |
marginBottom | StringOrNumber |
ml | StringOrNumber |
marginLeft | StringOrNumber |
mx | StringOrNumber |
marginX | StringOrNumber |
my | StringOrNumber |
marginY | StringOrNumber |
p | StringOrNumber |
padding | StringOrNumber |
pt | StringOrNumber |
paddingTop | StringOrNumber |
pr | StringOrNumber |
paddingRight | StringOrNumber |
pb | StringOrNumber |
paddingBottom | StringOrNumber |
pl | StringOrNumber |
paddingLeft | StringOrNumber |
px | StringOrNumber |
paddingX | StringOrNumber |
py | StringOrNumber |
paddingY | StringOrNumber |
color | Color |
bg | Color |
backgroundColor | Color |
opacity | Opacity |
width | StringOrNumber |
minWidth | StringOrNumber |
maxWidth | StringOrNumber |
height | StringOrNumber |
minHeight | StringOrNumber |
maxHeight | StringOrNumber |
size | StringOrNumber |
display | Display |
verticalAlign | VerticalAlign<0 | (string & {})> |
overflow | Overflow |
overflowX | OverflowX |
overflowY | OverflowY |
fontFamily | FontFamily |
fontStyle | FontStyle |
letterSpacing | LetterSpacing<0 | (string & {})> |
textAlign | TextAlign |
fontSize | string |
fontWeight | FontWeight |
lineHeight | StringOrNumber |
alignItems | AlignItems |
alignContent | AlignContent |
justifyItems | JustifyItems |
justifyContent | JustifyContent |
flexWrap | FlexWrap |
flexDirection | FlexDirection |
flex | Flex<Length> |
flexGrow | FlexGrow |
flexShrink | FlexShrink |
flexBasis | FlexBasis<Length> |
justifySelf | JustifySelf |
alignSelf | AlignSelf |
order | Order |
gridGap | GridGap<Length> |
gridRowGap | GridRowGap<Length> |
gridColumnGap | GridColumnGap<Length> |
gridColumn | GridColumn |
gridColumnStart | GridColumnStart |
gridColumnEnd | GridColumnEnd |
gridRow | GridRow |
gridRowStart | GridRowStart |
gridRowEnd | GridRowEnd |
gridArea | GridArea |
gridTemplateRows | GridTemplateRows<0 | (string & {})> |
gridTemplateColumns | GridTemplateColumns<0 | (string & {})> |
gridTemplateAreas | GridTemplateAreas |
border | string |
borderTop | string |
borderRight | string |
borderBottom | string |
borderLeft | string |
borderWidth | StringOrNumber |
borderColor | Color |
borderTopColor | Color |
borderRightColor | Color |
borderBottomColor | Color |
borderLeftColor | Color |
borderRadius | string |
position | Position |
zIndex | ZIndex |
top | string |
right | string |
bottom | string |
left | string |
boxShadow | BoxShadow |
textShadow | TextShadow |
#
FlexItem字段 | 描述 |
---|---|
span | ResponsiveType |
as | any |
style | CSSProperties |
className | string |
m | StringOrNumber |
margin | StringOrNumber |
mt | StringOrNumber |
marginTop | StringOrNumber |
mr | StringOrNumber |
marginRight | StringOrNumber |
mb | StringOrNumber |
marginBottom | StringOrNumber |
ml | StringOrNumber |
marginLeft | StringOrNumber |
mx | StringOrNumber |
marginX | StringOrNumber |
my | StringOrNumber |
marginY | StringOrNumber |
p | StringOrNumber |
padding | StringOrNumber |
pt | StringOrNumber |
paddingTop | StringOrNumber |
pr | StringOrNumber |
paddingRight | StringOrNumber |
pb | StringOrNumber |
paddingBottom | StringOrNumber |
pl | StringOrNumber |
paddingLeft | StringOrNumber |
px | StringOrNumber |
paddingX | StringOrNumber |
py | StringOrNumber |
paddingY | StringOrNumber |
color | Color |
bg | Color |
backgroundColor | Color |
opacity | Opacity |
width | StringOrNumber |
minWidth | StringOrNumber |
maxWidth | StringOrNumber |
height | StringOrNumber |
minHeight | StringOrNumber |
maxHeight | StringOrNumber |
size | StringOrNumber |
display | Display |
verticalAlign | VerticalAlign<0 | (string & {})> |
overflow | Overflow |
overflowX | OverflowX |
overflowY | OverflowY |
fontFamily | FontFamily |
fontStyle | FontStyle |
letterSpacing | LetterSpacing<0 | (string & {})> |
textAlign | TextAlign |
fontSize | string |
fontWeight | FontWeight |
lineHeight | StringOrNumber |
alignItems | AlignItems |
alignContent | AlignContent |
justifyItems | JustifyItems |
justifyContent | JustifyContent |
flexWrap | FlexWrap |
flexDirection | FlexDirection |
flex | Flex<Length> |
flexGrow | FlexGrow |
flexShrink | FlexShrink |
flexBasis | FlexBasis<Length> |
justifySelf | JustifySelf |
alignSelf | AlignSelf |
order | Order |
gridGap | GridGap<Length> |
gridRowGap | GridRowGap<Length> |
gridColumnGap | GridColumnGap<Length> |
gridColumn | GridColumn |
gridColumnStart | GridColumnStart |
gridColumnEnd | GridColumnEnd |
gridRow | GridRow |
gridRowStart | GridRowStart |
gridRowEnd | GridRowEnd |
gridArea | GridArea |
gridTemplateRows | GridTemplateRows<0 | (string & {})> |
gridTemplateColumns | GridTemplateColumns<0 | (string & {})> |
gridTemplateAreas | GridTemplateAreas |
border | string |
borderTop | string |
borderRight | string |
borderBottom | string |
borderLeft | string |
borderWidth | StringOrNumber |
borderColor | Color |
borderTopColor | Color |
borderRightColor | Color |
borderBottomColor | Color |
borderLeftColor | Color |
borderRadius | string |
position | Position |
zIndex | ZIndex |
top | string |
right | string |
bottom | string |
left | string |
boxShadow | BoxShadow |
textShadow | TextShadow |