Files
element-plus/packages/components/text/src/text.ts
yuhengshen cfc661c626 feat(types): [components] add public prop types (#21222)
* feat(types): [utils] add ExtractPublicPropTypes type

* feat(types): [components] add props public type

* chore(types): use type-only import for Prop from 'vue'

Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>

---------

Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>
2025-07-07 00:51:32 +08:00

44 lines
900 B
TypeScript

import { buildProps } from '@element-plus/utils'
import { componentSizes } from '@element-plus/constants'
import type { ExtractPropTypes, __ExtractPublicPropTypes } 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: 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>
export type TextPropsPublic = __ExtractPublicPropTypes<typeof textProps>