mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* 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>
44 lines
900 B
TypeScript
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>
|