Skip to content

Commit

Permalink
fix(color-picker): recentColors delete
Browse files Browse the repository at this point in the history
  • Loading branch information
superNos committed Nov 5, 2024
1 parent 37e7fb7 commit 894273f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/color-picker/panel/swatches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,10 @@ export default defineComponent({
* 移除颜色
*/
const handleRemoveColor = () => {
const colors = [...props.colors];
const colors = props.colors;

Check failure on line 72 in src/color-picker/panel/swatches.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / test

Use object destructuring
const selectedIndex = selectedColorIndex.value;
if (selectedIndex > -1) {
colors.splice(selectedIndex, 1);
} else {
colors.length = 0;
}
if (selectedIndex === -1) return

Check failure on line 74 in src/color-picker/panel/swatches.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / test

Missing semicolon

Check failure on line 74 in src/color-picker/panel/swatches.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / test

Missing semicolon
colors.splice(selectedIndex, 1);
props.handleChange?.(colors);
setVisiblePopConfirm(false);
};
Expand Down

0 comments on commit 894273f

Please sign in to comment.