Skip to content

布局单元格 cell ​

用法 ​

作为 flex 元素的直接子元素使用。

php
row
(
    set::align('center'),
    cell
    (
        set::order(2),
        set::flex('auto'),
        set::align('flex-end'),
        'Cell 1',
    ),
    cell
    (
        set::width(50),
        set::flex('none'),
        'Cell 2',
    ),
);
html
<div class="row items-center">
    <div class="cell flex-auto" style="order: 2; align-self: flex-end;">Cell 1</div>
    <div class="cell flex-none" style="flex-basis: 50px;">Cell 2</div>
</div>

属性 ​

名称 类型 可选 声明默认值 说明
flexstring是—生成对应的 flex-* 类,例如 auto、none 或 1。组合值用 grow、shrink 和 width 分别设置。
orderint是—CSS order 属性。
growint是—flex-grow 属性。
shrinkint是—flex-shrink 属性。
widthstringint是—CSS flex-basis 属性。数值按像素设置,分数如 1/3 转成百分比,也可直接使用 30%。
alignstring是—align-self 属性,例如 'auto'、'flex-start'、'flex-end'、'center'、'baseline'、'stretch'。