mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* test(components): [text] el-text unit test * docs(components): [text] el-text website documentation * feat(components): [text] el-text implementation * fix(components): [text] prop 'as' rename 'tag' * docs(components): [text] rename slot default, optimize document * test(components): [text] render text & class change the execution order * fix(components): [text] use template and render function together
40 lines
813 B
TypeScript
40 lines
813 B
TypeScript
import { buildProps } from '@element-plus/utils'
|
|
import { componentSizes } from '@element-plus/constants'
|
|
import type Text from './text.vue'
|
|
|
|
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 custom element tag
|
|
*/
|
|
tag: {
|
|
type: String,
|
|
default: 'span',
|
|
},
|
|
} as const)
|
|
export type TextProps = ExtractPropTypes<typeof textProps>
|
|
export type TextInstance = InstanceType<typeof Text>
|