mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [color-picker] add persistent and append-to prop (#21393)
This commit is contained in:
@@ -60,6 +60,8 @@ color-picker/sizes
|
||||
| id | ColorPicker id | ^[string] | — |
|
||||
| teleported ^(2.7.2) | whether color-picker popper is teleported to the body | ^[boolean] | true |
|
||||
| label ^(a11y) ^(deprecated) | ColorPicker aria-label | ^[string] | — |
|
||||
| persistent ^(2.10.5) | when color-picker inactive and persistent is false, the color panel will be destroyed | ^[boolean] | true |
|
||||
| append-to ^(2.10.5) | which element the color-picker panel appends to | ^[CSSSelector] / ^[HTMLElement] | - |
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@@ -17,6 +17,13 @@ import type {
|
||||
import type ColorPicker from './color-picker.vue'
|
||||
|
||||
export const colorPickerProps = buildProps({
|
||||
/**
|
||||
* @description when color-picker inactive and persistent is false, the color panel will be destroyed
|
||||
*/
|
||||
persistent: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* @description binding value
|
||||
*/
|
||||
@@ -62,6 +69,10 @@ export const colorPickerProps = buildProps({
|
||||
* @description whether color-picker popper is teleported to the body
|
||||
*/
|
||||
teleported: useTooltipContentProps.teleported,
|
||||
/**
|
||||
* @description which color-picker panel appends to
|
||||
*/
|
||||
appendTo: useTooltipContentProps.appendTo,
|
||||
/**
|
||||
* @description predefined color options
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
trigger="click"
|
||||
:teleported="teleported"
|
||||
:transition="`${ns.namespace.value}-zoom-in-top`"
|
||||
persistent
|
||||
:persistent="persistent"
|
||||
:append-to="appendTo"
|
||||
@hide="setShowPicker(false)"
|
||||
>
|
||||
<template #content>
|
||||
|
||||
Reference in New Issue
Block a user