mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
refactor(components): [popper]redfine the prop role type (#9471)
* refactor(components): [popper]redfine the prop role type * chore: remove unnecessary code * refactor(components): [popper]update variable name
This commit is contained in:
parent
27e447b3ca
commit
5c8c369594
@ -1,6 +1,6 @@
|
||||
import { buildProps } from '@element-plus/utils'
|
||||
|
||||
import type { ExtractPropTypes, PropType } from 'vue'
|
||||
import type { ExtractPropTypes } from 'vue'
|
||||
|
||||
const effects = ['light', 'dark'] as const
|
||||
const triggers = ['click', 'contextmenu', 'hover', 'focus'] as const
|
||||
@ -8,16 +8,24 @@ const triggers = ['click', 'contextmenu', 'hover', 'focus'] as const
|
||||
export const Effect = {
|
||||
LIGHT: 'light',
|
||||
DARK: 'dark',
|
||||
}
|
||||
} as const
|
||||
|
||||
export const roleTypes = [
|
||||
'dialog',
|
||||
'grid',
|
||||
'listbox',
|
||||
'menu',
|
||||
'tooltip',
|
||||
'tree',
|
||||
] as const
|
||||
|
||||
export type PopperEffect = typeof effects[number]
|
||||
export type PopperTrigger = typeof triggers[number]
|
||||
|
||||
export const usePopperProps = buildProps({
|
||||
role: {
|
||||
type: String as PropType<
|
||||
'dialog' | 'grid' | 'listbox' | 'menu' | 'tooltip' | 'tree'
|
||||
>,
|
||||
type: String,
|
||||
values: roleTypes,
|
||||
default: 'tooltip',
|
||||
},
|
||||
} as const)
|
||||
|
Loading…
Reference in New Issue
Block a user