Text 文本

用于展示文本。

基础用法

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

DefaultPrimarySuccessInfoWarningDanger

尺寸

使用 size 属性设置尺寸,可选 largedefaultsmall

LargeDefaultSmall

省略

传入 truncated 在文本超出视口或所设最大宽度时显示省略号。使用 line-clamp 实现多行省略。

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.

覆盖元素

使用 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默认内容