Text 文本 ​

用于展示文本。

基础用法 ​

使用 type 属性定义文本类型。

DefaultPrimarySuccessInfoWarningDanger

尺寸 ​

使用 size 属性设置尺寸,可选 large、default 或 small。

LargeDefaultSmall

省略 ​

传入 truncated 在文本超出视口或所设最大宽度时显示省略号。使用 line-clamp 实现多行省略。自 0.1.17 起暴露 isTruncated,表示文本当前是否被截断。

Self element set width 100px
Squeezed by parent element
The -webkit-line-clamp CSS property
allows limiting of the contents of
a block to the specified number of lines.
Show tooltip only when the text is truncated

isTruncated: false

覆盖元素 ​

使用 tag 属性覆盖渲染的元素标签。

span

This is a paragraph.

Bold
Italic
This is subscript
This is superscript
Inserted
Deleted
Marked

混合内容 ​

文本与其他组件混合展示。

Element-Plus
Rate
This is text mixed icon and component

API ​

属性 ​

名称说明类型默认值
type文本类型enum—
size文本尺寸enumdefault
truncated是否显示省略号booleanfalse
line-clamp最大行数string / number—
tag自定义元素标签stringspan

插槽 ​

名称说明
default默认内容

暴露 ​

名称说明类型
isTruncated 0.1.17文本当前是否被截断object
updateTooltip手动更新 Tooltip 状态Function