布局容器

文档版本:1.1.0

组件名:BhtLayoutContainer

描述

布局容器组件,用于按行列划分区域并承载其他组件。

效果

布局容器 效果图

示例

<bht-layout-container></bht-layout-container>

代码

<bht-layout-container :ref="item.id" :item="item"></bht-layout-container>

<BhtLayoutContainer :ref="item.id" :item="item"></BhtLayoutContainer>

参数

参数类型必填默认值说明
itemObject-组件配置信息。
configOnlyBooleanfalse-

组件配置项

key名称类型默认值说明
rows行数string2请输入行数
columns列数string2请输入列数
gap间距string12px例如 12px
columnWidths列宽string-逗号分隔,例如 1fr, 320px, 25%
rowHeights行高string-逗号分隔,例如 auto, 240px, 30vh
margin外边距string0例如 0、16px、12px 0
padding内边距string16px例如 16px
minHeight最小高度string160px例如 160px
height固定高度string-可选,例如 480px
cellMinHeight单元最小高度string120px例如 120px
cellPadding单元内边距string10px例如 10px
backgroundColor背景颜色color#ffffff请选择背景颜色
borderColor边框颜色color#e5e7eb请选择边框颜色
borderWidth边框宽度string1px例如 1px
borderStyle边框样式stringsolid请选择边框样式
cellBackgroundColor单元背景色color#f8fafc请选择单元背景色
cellBorderColor单元边框色color#cbd5e1请选择单元边框色
cellBorderStyle单元边框stringdashed请选择单元边框
cellBorderRadius单元圆角string6px例如 6px
alignItems垂直对齐stringstretch请选择垂直对齐
justifyItems水平对齐stringstretch请选择水平对齐
cellOverflow内容溢出stringvisible请选择内容溢出
borderRadius圆角string8px例如 8px
boxShadow阴影stringnone例如 0 12px 24px rgba(15,23,42,.08)
opacity透明度string10 到 1,例如 0.95
boxSizing盒模型stringborder-box请选择盒模型
customStyle自定义样式string-例如 box-shadow: none;
cellCustomStyle单元自定义样式string-例如 place-items: center;

通用布局配置

key名称类型默认值说明
componentWidth组件宽度string100%支持 100%、320px、50vw
componentHeight组件高度string-可选,例如 360px、50vh
componentPositionMode布局模式selectflowflow、absolute、fixed
componentPositionXX 位置string-自由/固定模式,例如 120px
componentPositionYY 位置string-自由/固定模式,例如 80px
componentZIndex层级string-例如 10
componentHorizontalAlign水平对齐selectcenterleft、center、right、stretch
componentVerticalAlign垂直对齐selecttoptop、middle、bottom、stretch
componentLocked锁定位置selectfalsetrue、false
componentRelativeTo参照组件 IDselect-可选择其他已有组件的 id 和名称
componentRelativePlacement相对位置select-right、left、bottom、top
componentRelativeGap相对间距string12px例如 12px

通用样式配置

key名称类型默认值说明
componentMargin外边距string-例如 16px 或 12px 24px
componentPadding内边距string-例如 16px 或 12px 24px
componentMinWidth最小宽度string-例如 240px
componentMaxWidth最大宽度string-例如 1200px 或 none
componentMinHeight最小高度string-例如 120px
componentMaxHeight最大高度string-例如 720px 或 none
componentBackgroundColor背景颜色color-例如 #ffffff 或 rgba(255,255,255,.9)
componentBackgroundImage背景图片string-例如 url(https://...) 或 linear-gradient(...)
componentBackgroundSize背景尺寸string-例如 cover、contain、100% 100%
componentBackgroundPosition背景位置string-例如 center、left top
componentBackgroundRepeat背景重复select-no-repeat、repeat、repeat-x、repeat-y
componentBorderColor边框颜色color-请选择边框颜色
componentBorderWidth边框宽度string-例如 1px 或 1px 0 0
componentBorderStyle边框样式select-solid、dashed、dotted、none
componentBorderRadius圆角string-例如 8px 或 12px 12px 0 0
componentBoxShadow阴影string-例如 0 12px 32px rgba(15,23,42,.12)
componentOpacity透明度string-0 到 1,例如 .95
componentOverflow溢出处理select-visible、hidden、auto、clip
componentTextAlign文本对齐select-left、center、right、justify
componentColor文字颜色color-请选择文字颜色
componentBoxSizing盒模型selectborder-boxborder-box、content-box
componentFilter滤镜string-例如 blur(2px)、grayscale(1)
componentBackdropFilter背景滤镜string-例如 blur(12px)
componentCustomStyle自定义 CSStextarea-例如 transform: translateY(8px);

引入

import { BhtLayoutContainer } from '@behappyto/cms-ui-vue3'