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>
38 lines
948 B
TypeScript
38 lines
948 B
TypeScript
import { buildProps, definePropType, iconPropType } from '@element-plus/utils'
|
|
import { ArrowRight } from '@element-plus/icons-vue'
|
|
|
|
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'
|
|
import type { CollapseActiveName } from './collapse'
|
|
|
|
export const collapseItemProps = buildProps({
|
|
/**
|
|
* @description title of the panel
|
|
*/
|
|
title: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
/**
|
|
* @description unique identification of the panel
|
|
*/
|
|
name: {
|
|
type: definePropType<CollapseActiveName>([String, Number]),
|
|
default: undefined,
|
|
},
|
|
/**
|
|
* @description icon of the collapse item
|
|
*/
|
|
icon: {
|
|
type: iconPropType,
|
|
default: ArrowRight,
|
|
},
|
|
/**
|
|
* @description disable the collapse item
|
|
*/
|
|
disabled: Boolean,
|
|
} as const)
|
|
export type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>
|
|
export type CollapseItemPropsPublic = __ExtractPublicPropTypes<
|
|
typeof collapseItemProps
|
|
>
|