From 8b556005d7488bb701c84e48e960625372270d82 Mon Sep 17 00:00:00 2001 From: xachary <179740385@qq.com> Date: Sun, 18 Feb 2024 09:34:47 +0800 Subject: [PATCH] fix(PopConfirmButton): avoid type lint error --- src/components/Button/src/PopConfirmButton.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/Button/src/PopConfirmButton.vue b/src/components/Button/src/PopConfirmButton.vue index b7f325a9564..b641156bd55 100644 --- a/src/components/Button/src/PopConfirmButton.vue +++ b/src/components/Button/src/PopConfirmButton.vue @@ -38,8 +38,9 @@ }); return () => { - const bindValues = omit(unref(getBindValues), 'icon'); - const btnBind = omit(bindValues, 'title') as any; + // 用 omit 剔除一些已知可能导致异常的属性 + const bindValues = omit(unref(getBindValues), 'icon', 'color'); + const btnBind = omit(unref(getBindValues), 'title') as any; if (btnBind.disabled) btnBind.color = ''; const Button = h(BasicButton, btnBind, extendSlots(slots)); @@ -47,9 +48,6 @@ if (!props.enable) { return Button; } - if (bindValues.color) { - delete bindValues.color; - } return h(Popconfirm, bindValues, { default: () => Button }); }; },