From 85592a8c0f8c4e404615691ad10c26b7e6b1137b Mon Sep 17 00:00:00 2001 From: wuxx <1239378684@qq.com> Date: Mon, 11 Nov 2024 10:43:17 +0800 Subject: [PATCH 1/4] fix(color-picker): recentColors delete --- src/color-picker/panel/swatches.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/color-picker/panel/swatches.tsx b/src/color-picker/panel/swatches.tsx index 9654666593..cacdc5dc7d 100644 --- a/src/color-picker/panel/swatches.tsx +++ b/src/color-picker/panel/swatches.tsx @@ -60,13 +60,10 @@ export default defineComponent({ * 移除颜色 */ const handleRemoveColor = () => { - const colors = [...props.colors]; + const { colors } = props; const selectedIndex = selectedColorIndex.value; - if (selectedIndex > -1) { - colors.splice(selectedIndex, 1); - } else { - colors.length = 0; - } + if (selectedIndex === -1) return; + colors.splice(selectedIndex, 1); props.onChange(colors); setVisiblePopConfirm(false); }; From 9e2c98143aa979f59b06f80a0697bc23b26ec033 Mon Sep 17 00:00:00 2001 From: wuxx <1239378684@qq.com> Date: Mon, 11 Nov 2024 10:44:16 +0800 Subject: [PATCH 2/4] fix(color-picker): recentColors delete --- src/color-picker/panel/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/color-picker/panel/index.tsx b/src/color-picker/panel/index.tsx index 837f4b3925..30250d26ab 100644 --- a/src/color-picker/panel/index.tsx +++ b/src/color-picker/panel/index.tsx @@ -277,7 +277,6 @@ export default defineComponent({ baseClassName, statusClassNames, globalConfig, - recentColors, swatchColors, showPrimaryColorPreview, isGradient, @@ -286,7 +285,7 @@ export default defineComponent({ color: this.color, disabled: this.disabled, }; - const showUsedColors = recentColors !== null && recentColors !== false; + const showUsedColors = this.recentlyUsedColors !== null && this.recentlyUsedColors !== false; let systemColors = swatchColors; if (systemColors === undefined) { From 0dfab640774db1042776d8bd35ba88749925a0de Mon Sep 17 00:00:00 2001 From: wuxx <1239378684@qq.com> Date: Mon, 11 Nov 2024 15:00:01 +0800 Subject: [PATCH 3/4] fix(color-picker): lint format --- src/color-picker/panel/index.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/color-picker/panel/index.tsx b/src/color-picker/panel/index.tsx index 30250d26ab..75a8b111b4 100644 --- a/src/color-picker/panel/index.tsx +++ b/src/color-picker/panel/index.tsx @@ -272,15 +272,7 @@ export default defineComponent({ }; }, render() { - const { - t, - baseClassName, - statusClassNames, - globalConfig, - swatchColors, - showPrimaryColorPreview, - isGradient, - } = this; + const { t, baseClassName, statusClassNames, globalConfig, swatchColors, showPrimaryColorPreview, isGradient } = this; const baseProps = { color: this.color, disabled: this.disabled, From bc2fcbcc1a5f4d6c949993323c4a0631ee6d3881 Mon Sep 17 00:00:00 2001 From: wuxx <1239378684@qq.com> Date: Tue, 12 Nov 2024 15:05:10 +0800 Subject: [PATCH 4/4] fix(color-picker): lint format --- src/color-picker/panel/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/color-picker/panel/index.tsx b/src/color-picker/panel/index.tsx index 75a8b111b4..bc45162fe1 100644 --- a/src/color-picker/panel/index.tsx +++ b/src/color-picker/panel/index.tsx @@ -272,7 +272,8 @@ export default defineComponent({ }; }, render() { - const { t, baseClassName, statusClassNames, globalConfig, swatchColors, showPrimaryColorPreview, isGradient } = this; + const { t, baseClassName, statusClassNames, globalConfig, swatchColors, showPrimaryColorPreview, isGradient } = + this; const baseProps = { color: this.color, disabled: this.disabled,