mirror of
https://github.com/element-plus/element-plus.git
synced 2025-03-07 15:47:57 +08:00
fix(components): [color-picker] optimize the flickering issue (#18872)
* fix(components): [color-picker] Optimize the flickering issue * fix(components): [color-picker] remove meaningless comments
This commit is contained in:
parent
d2b17bcd0c
commit
515359004b
@ -16,7 +16,10 @@
|
||||
@hide="setShowPicker(false)"
|
||||
>
|
||||
<template #content>
|
||||
<div v-click-outside="handleClickOutside" @keydown.esc="handleEsc">
|
||||
<div
|
||||
v-click-outside:[triggerRef]="handleClickOutside"
|
||||
@keydown.esc="handleEsc"
|
||||
>
|
||||
<div :class="ns.be('dropdown', 'main-wrapper')">
|
||||
<hue-slider ref="hue" class="hue-slider" :color="color" vertical />
|
||||
<sv-panel ref="sv" :color="color" />
|
||||
@ -245,7 +248,6 @@ function setShowPicker(value: boolean) {
|
||||
}
|
||||
|
||||
const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true })
|
||||
|
||||
function show() {
|
||||
if (colorDisabled.value) return
|
||||
setShowPicker(true)
|
||||
@ -271,6 +273,9 @@ function resetColor() {
|
||||
|
||||
function handleTrigger() {
|
||||
if (colorDisabled.value) return
|
||||
if (showPicker.value) {
|
||||
resetColor()
|
||||
}
|
||||
debounceSetShowPicker(!showPicker.value)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user