mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
feat(components): [color-picker] add show
hide
expose (#11942)
* feat(components): [color-picker] add handleTrigger expose closed #11926
This commit is contained in:
parent
80a005714d
commit
e6be1bc3cb
@ -73,5 +73,7 @@ color-picker/sizes
|
||||
### Exposes
|
||||
|
||||
| Name | Description | Type |
|
||||
| ----- | -------------------- | ---------------- |
|
||||
| ----- | ------------------------- | ----------------------- |
|
||||
| color | current color object | ^[object]`Color` |
|
||||
| show | manually show ColorPicker | ^[Function]`() => void` |
|
||||
| hide | manually hide ColorPicker | ^[Function]`() => void` |
|
||||
|
@ -217,6 +217,11 @@ function setShowPicker(value: boolean) {
|
||||
|
||||
const debounceSetShowPicker = debounce(setShowPicker, 100)
|
||||
|
||||
function show() {
|
||||
if (colorDisabled.value) return
|
||||
setShowPicker(true)
|
||||
}
|
||||
|
||||
function hide() {
|
||||
debounceSetShowPicker(false)
|
||||
resetColor()
|
||||
@ -331,5 +336,13 @@ defineExpose({
|
||||
* @description current color object
|
||||
*/
|
||||
color,
|
||||
/**
|
||||
* @description manually show ColorPicker
|
||||
*/
|
||||
show,
|
||||
/**
|
||||
* @description manually hide ColorPicker
|
||||
*/
|
||||
hide,
|
||||
})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user