Skip to main content

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#

字段描述
spacingStringOrNumber
间距
directionFlexDirection
子元素排列方向
alignAlignItems
y 轴对齐方式
justifyJustifyContent
x 轴对齐方式
wrapFlexWrap
basisFlexBasis<Length>
growFlexGrow
shrinkFlexShrink
asany
styleCSSProperties
classNamestring
mStringOrNumber
marginStringOrNumber
mtStringOrNumber
marginTopStringOrNumber
mrStringOrNumber
marginRightStringOrNumber
mbStringOrNumber
marginBottomStringOrNumber
mlStringOrNumber
marginLeftStringOrNumber
mxStringOrNumber
marginXStringOrNumber
myStringOrNumber
marginYStringOrNumber
pStringOrNumber
paddingStringOrNumber
ptStringOrNumber
paddingTopStringOrNumber
prStringOrNumber
paddingRightStringOrNumber
pbStringOrNumber
paddingBottomStringOrNumber
plStringOrNumber
paddingLeftStringOrNumber
pxStringOrNumber
paddingXStringOrNumber
pyStringOrNumber
paddingYStringOrNumber
colorColor
bgColor
backgroundColorColor
opacityOpacity
widthStringOrNumber
minWidthStringOrNumber
maxWidthStringOrNumber
heightStringOrNumber
minHeightStringOrNumber
maxHeightStringOrNumber
sizeStringOrNumber
displayDisplay
verticalAlignVerticalAlign<0 | (string & {})>
overflowOverflow
overflowXOverflowX
overflowYOverflowY
fontFamilyFontFamily
fontStyleFontStyle
letterSpacingLetterSpacing<0 | (string & {})>
textAlignTextAlign
fontSizestring
fontWeightFontWeight
lineHeightStringOrNumber
alignItemsAlignItems
alignContentAlignContent
justifyItemsJustifyItems
justifyContentJustifyContent
flexWrapFlexWrap
flexDirectionFlexDirection
flexFlex<Length>
flexGrowFlexGrow
flexShrinkFlexShrink
flexBasisFlexBasis<Length>
justifySelfJustifySelf
alignSelfAlignSelf
orderOrder
gridGapGridGap<Length>
gridRowGapGridRowGap<Length>
gridColumnGapGridColumnGap<Length>
gridColumnGridColumn
gridColumnStartGridColumnStart
gridColumnEndGridColumnEnd
gridRowGridRow
gridRowStartGridRowStart
gridRowEndGridRowEnd
gridAreaGridArea
gridTemplateRowsGridTemplateRows<0 | (string & {})>
gridTemplateColumnsGridTemplateColumns<0 | (string & {})>
gridTemplateAreasGridTemplateAreas
borderstring
borderTopstring
borderRightstring
borderBottomstring
borderLeftstring
borderWidthStringOrNumber
borderColorColor
borderTopColorColor
borderRightColorColor
borderBottomColorColor
borderLeftColorColor
borderRadiusstring
positionPosition
zIndexZIndex
topstring
rightstring
bottomstring
leftstring
boxShadowBoxShadow
textShadowTextShadow

FlexItem#

字段描述
spanResponsiveType
asany
styleCSSProperties
classNamestring
mStringOrNumber
marginStringOrNumber
mtStringOrNumber
marginTopStringOrNumber
mrStringOrNumber
marginRightStringOrNumber
mbStringOrNumber
marginBottomStringOrNumber
mlStringOrNumber
marginLeftStringOrNumber
mxStringOrNumber
marginXStringOrNumber
myStringOrNumber
marginYStringOrNumber
pStringOrNumber
paddingStringOrNumber
ptStringOrNumber
paddingTopStringOrNumber
prStringOrNumber
paddingRightStringOrNumber
pbStringOrNumber
paddingBottomStringOrNumber
plStringOrNumber
paddingLeftStringOrNumber
pxStringOrNumber
paddingXStringOrNumber
pyStringOrNumber
paddingYStringOrNumber
colorColor
bgColor
backgroundColorColor
opacityOpacity
widthStringOrNumber
minWidthStringOrNumber
maxWidthStringOrNumber
heightStringOrNumber
minHeightStringOrNumber
maxHeightStringOrNumber
sizeStringOrNumber
displayDisplay
verticalAlignVerticalAlign<0 | (string & {})>
overflowOverflow
overflowXOverflowX
overflowYOverflowY
fontFamilyFontFamily
fontStyleFontStyle
letterSpacingLetterSpacing<0 | (string & {})>
textAlignTextAlign
fontSizestring
fontWeightFontWeight
lineHeightStringOrNumber
alignItemsAlignItems
alignContentAlignContent
justifyItemsJustifyItems
justifyContentJustifyContent
flexWrapFlexWrap
flexDirectionFlexDirection
flexFlex<Length>
flexGrowFlexGrow
flexShrinkFlexShrink
flexBasisFlexBasis<Length>
justifySelfJustifySelf
alignSelfAlignSelf
orderOrder
gridGapGridGap<Length>
gridRowGapGridRowGap<Length>
gridColumnGapGridColumnGap<Length>
gridColumnGridColumn
gridColumnStartGridColumnStart
gridColumnEndGridColumnEnd
gridRowGridRow
gridRowStartGridRowStart
gridRowEndGridRowEnd
gridAreaGridArea
gridTemplateRowsGridTemplateRows<0 | (string & {})>
gridTemplateColumnsGridTemplateColumns<0 | (string & {})>
gridTemplateAreasGridTemplateAreas
borderstring
borderTopstring
borderRightstring
borderBottomstring
borderLeftstring
borderWidthStringOrNumber
borderColorColor
borderTopColorColor
borderRightColorColor
borderBottomColorColor
borderLeftColorColor
borderRadiusstring
positionPosition
zIndexZIndex
topstring
rightstring
bottomstring
leftstring
boxShadowBoxShadow
textShadowTextShadow
Copyright © 2021 Alibaba Inc.
Built with ❤️ by hema-FE.