Skip to content

文本

image

介绍

文字展示组件

API

Props

参数名描述类型默认值
status默认状态'default' | 'disbaled' | 'hide''default'
type类型'title' | 'text' | 'paragraph''text'
data内容string文本
titleLevel标题级别'h1' | 'h2' | 'h3' | 'h4'| 'h5''h1'
expandRows最大行数string-
textType文本类型'secondary'|'primary'|'success'|'danger'|'warning''secondary'
fontStyle样式'bold'|'code'|'delete'|'underline'|'mark'-
copyable复制booleanfalse
editable编辑booleanfalse
ellipsis超出省略booleanfalse
expandable展开折叠booleanfalse
baseStyle自定义样式 , 表格整体自定义样式string-
customClass类名绑定string-
width宽 , 布局容器宽度string-
opacity不透明度 , 布局容器背景色透明度string-
display显示, 设置组件的显示布局模式Display-
boxStyle盒模型, margin,border,padding设置BoxStyle-
fontSize字号number-
lineHeight行高number-
fontWeight字重'100'|'normal'|'500'|'600'|'700'|'900''normal'
textColor文字颜色string-
textAlign对齐'left'|'center'|'right'|'justify''left'
background背景Background-
boxShadow阴影BoxShadow-
uniqueKey唯一标识, 组件的唯一标识string-
loop循环数据, 循环渲染设置Loop-

Events

事件名描述参数
editSaveEvent保存事件ctx
params:MouseEvent
onClick点击按钮ctx
params:MouseEvent
onMousedown鼠标按下时触发ctx
params:MouseEvent
onMouseup鼠标松开时触发ctx
params:MouseEvent

Type

javascript

//显示
type Display = {
  type:"block"|"inline-block"|"inline"|"flex",
  // type选择flex可配置以下属性
  flex:{
    flexDirection:"row"|"column"|"row-reverse"|"column-reverse",
    alignItems:"flex-start"|"center"|"flex-end"|"stretch"|"base-line",
    justifyContent:"flex-start"|"center"|"flex-end"|"space-between"|"space-around"
  }
}

// 盒模型
type BoxStyle = {
  "marigin": [string|string|string|string],
  "border": [string|string|string|string],
  "padding": [string|string|string|string],
  "borderColor": 'color-border-1'|'color-border-2'|'color-border-3'|'color-border-4',
  "borderStyle": 'solid'|'dotted'|'dashed'
}

// 盒模型
type Collapse = {
  "marigin": [string|string|string|string],
  "border": [string|string|string|string],
  "padding": [string|string|string|string],
  "borderColor": 'color-border-1'|'color-border-2'|'color-border-3'|'color-border-4',
  "borderStyle": 'solid'|'dotted'|'dashed'
}

// 背景样式
type Background = {
  "color": string,
  "size": "cover"|"contain"|"length"
  "width": {
    "unit": "px"|"%",
    "value": number
  }
  "height":{
    "unit": "px"|"%",
    "value": number
  }
}

// 阴影
type BoxShadow = {
  "color":string,
  "hShadow":string,
  "vShadow":string,
  "blur":number,
}

// 循环
type Loop = {
  "data": any[],
  "paramName": string,
  "indexName": string,
  "key": string
}