Skip to main content

flexbox

插件名#

flexbox

安装#

npm install @jswork/styled-plugin-flexbox

参数#

名称类型description
valuestring对齐方式

value#

名称类型description
centerstring水平/垂直居中
lastring右边定值; 右边 auto
larstring左边定值; 中间 auto; 右边定值
arstring中间 auto; 右边定值
lrstring左/右分散对齐
tastring上边定值; 下边 auto
tabstring上边定值; 中间 auto; 下边定值
abstring中间 auto; 下边定值
tbstring上/下分散对齐

绝对居中的一种实现方式。

原理#

  1. flexbox 布局,2/3 列的组合
  2. 可配合 align/justify 使用

用法#

<View plugin="flexbox:la">  <View p={10} bg="#f80" debug className="is-left">    Left  </View>  <View p={10} bg="#eee" debug className="is-right">    Auto  </View></View>

演示#

Live Editor
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^