mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* docs(components): [text] line-clamp prop and update example * test(components): [text] line-clamp test * fix(components): [text] not support multi-line ellipsis * docs: updata --------- Co-authored-by: qiang <qw13131wang@gmail.com>
45 lines
818 B
TypeScript
45 lines
818 B
TypeScript
import { buildProps } from '@element-plus/utils'
|
|
import { componentSizes } from '@element-plus/constants'
|
|
|
|
import type { ExtractPropTypes } from 'vue'
|
|
|
|
export const textProps = buildProps({
|
|
/**
|
|
* @description text type
|
|
*/
|
|
type: {
|
|
type: String,
|
|
values: ['primary', 'success', 'info', 'warning', 'danger', ''],
|
|
default: '',
|
|
},
|
|
/**
|
|
* @description text size
|
|
*/
|
|
size: {
|
|
type: String,
|
|
values: componentSizes,
|
|
default: '',
|
|
},
|
|
/**
|
|
* @description render ellipsis
|
|
*/
|
|
truncated: {
|
|
type: Boolean,
|
|
},
|
|
/**
|
|
* @description maximum lines
|
|
*/
|
|
lineClamp: {
|
|
type: [String, Number],
|
|
},
|
|
/**
|
|
* @description custom element tag
|
|
*/
|
|
tag: {
|
|
type: String,
|
|
default: 'span',
|
|
},
|
|
} as const)
|
|
|
|
export type TextProps = ExtractPropTypes<typeof textProps>
|