mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-17 11:49:41 +08:00
feat(components): [color-picker] add teleported
prop (#16634)
* feat(components): [color-picker] add `teleported` prop closed #15357 * refactor: use tooltip hooks
This commit is contained in:
parent
245c7d9486
commit
53b6e16080
@ -63,6 +63,8 @@ color-picker/sizes
|
||||
| label ^(a11y) ^(deprecated) | ColorPicker aria-label | ^[string] | — |
|
||||
| aria-label ^(a11y) ^(2.7.2) | ColorPicker aria-label | ^[string] | — |
|
||||
| id | ColorPicker id | ^[string] | — |
|
||||
| teleported ^(2.7.2) | whether color-picker popper is teleported to the body | ^[boolean] | true |
|
||||
|
||||
|
||||
### Events
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { isNil } from 'lodash-unified'
|
||||
import { buildProps, definePropType, isString } from '@element-plus/utils'
|
||||
import { useAriaProps, useSizeProp } from '@element-plus/hooks'
|
||||
import { useTooltipContentProps } from '@element-plus/components/tooltip'
|
||||
import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'
|
||||
|
||||
import type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'
|
||||
@ -52,6 +53,10 @@ export const colorPickerProps = buildProps({
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
/**
|
||||
* @description whether color-picker popper is teleported to the body
|
||||
*/
|
||||
teleported: useTooltipContentProps.teleported,
|
||||
/**
|
||||
* @description predefined color options
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
||||
:stop-popper-mouse-event="false"
|
||||
effect="light"
|
||||
trigger="click"
|
||||
:teleported="teleported"
|
||||
:transition="`${ns.namespace.value}-zoom-in-top`"
|
||||
persistent
|
||||
@hide="setShowPicker(false)"
|
||||
|
Loading…
Reference in New Issue
Block a user