From 20dd04a91e8f16e8f36e5126c45c89b6c8335bea Mon Sep 17 00:00:00 2001 From: caiyong Date: Tue, 17 Nov 2020 11:08:00 +0800 Subject: [PATCH 1/2] fix: the button's loading property without delay --- components/button/button.tsx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/components/button/button.tsx b/components/button/button.tsx index f93cddd632..545100b11d 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -27,22 +27,25 @@ export default defineComponent({ large: 'lg', small: 'sm', }, - sLoading: !!this.loading, + sLoading: false, hasTwoCNChar: false, }; }, watch: { - loading(val, preVal) { - if (preVal && typeof preVal !== 'boolean') { - clearTimeout(this.delayTimeout); - } - if (val && typeof val !== 'boolean' && val.delay) { - this.delayTimeout = setTimeout(() => { + loading: { + handler(val, preVal) { + if (preVal && typeof preVal !== 'boolean') { + clearTimeout(this.delayTimeout); + } + if (val && typeof val !== 'boolean' && val.delay) { + this.delayTimeout = setTimeout(() => { + this.sLoading = !!val; + }, val.delay); + } else { this.sLoading = !!val; - }, val.delay); - } else { - this.sLoading = !!val; - } + } + }, + immediate: true, }, }, mounted() { From 8619031fe4e3da6b56ffa5bb58c962a404629488 Mon Sep 17 00:00:00 2001 From: caiyong Date: Wed, 2 Dec 2020 11:20:27 +0800 Subject: [PATCH 2/2] fix: missing the submenuopendelay and submenclosedelay properties --- components/vc-menu/SubPopupMenu.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/vc-menu/SubPopupMenu.jsx b/components/vc-menu/SubPopupMenu.jsx index 12f96927ea..eca8ae7ac6 100644 --- a/components/vc-menu/SubPopupMenu.jsx +++ b/components/vc-menu/SubPopupMenu.jsx @@ -108,6 +108,8 @@ const SubPopupMenu = { expandIcon: PropTypes.any, overflowedIndicator: PropTypes.any, children: PropTypes.any.def([]), + subMenuOpenDelay: PropTypes.number.def(0.1), + subMenuCloseDelay: PropTypes.number.def(0.1), forceSubMenuRender: PropTypes.looseBool.def(false), parentUniKeys: PropTypes.array.def(() => []), parentUniKey: PropTypes.string,