diff --git a/src/color-picker/panel/index.tsx b/src/color-picker/panel/index.tsx index d637a6a01..cb4032613 100644 --- a/src/color-picker/panel/index.tsx +++ b/src/color-picker/panel/index.tsx @@ -283,10 +283,10 @@ export default defineComponent({ }, render() { const { - baseClassName, statusClassNames, t, global, recentColors, swatchColors, previewColorStyle, isGradient, + baseClassName, statusClassNames, t, global, swatchColors, previewColorStyle, isGradient, } = this; - const showUsedColors = recentColors !== null && recentColors !== false; + const showUsedColors = this.recentlyUsedColors !== null && this.recentlyUsedColors !== false; let systemColors = swatchColors; if (systemColors === undefined) { diff --git a/src/color-picker/panel/swatches.tsx b/src/color-picker/panel/swatches.tsx index 9e8f4aed5..adfdc7cff 100644 --- a/src/color-picker/panel/swatches.tsx +++ b/src/color-picker/panel/swatches.tsx @@ -69,9 +69,9 @@ export default defineComponent({ * 移除颜色 */ const handleRemoveColor = () => { - const colors = props.colors; + const { colors } = props; const selectedIndex = selectedColorIndex.value; - if (selectedIndex === -1) return + if (selectedIndex === -1) return; colors.splice(selectedIndex, 1); props.handleChange?.(colors); setVisiblePopConfirm(false);