From a4539ae30736be48afa4e60c8e2c6164d38c6eab Mon Sep 17 00:00:00 2001 From: mertsincan Date: Sun, 11 Feb 2024 08:30:04 +0000 Subject: [PATCH 1/2] Refactor #5257 --- components/lib/inputswitch/InputSwitch.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/inputswitch/InputSwitch.vue b/components/lib/inputswitch/InputSwitch.vue index 8d3d8c5f3..0045a4fc3 100755 --- a/components/lib/inputswitch/InputSwitch.vue +++ b/components/lib/inputswitch/InputSwitch.vue @@ -32,7 +32,7 @@ export default { emits: ['update:modelValue', 'change', 'focus', 'blur'], methods: { getPTOptions(key) { - const _ptm = root === 'root' ? this.ptmi : this.ptm; + const _ptm = key === 'root' ? this.ptmi : this.ptm; return _ptm(key, { context: { From 5d9ac9917defa5e811cd44bdb141600fac827bb4 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Sun, 11 Feb 2024 08:46:46 +0000 Subject: [PATCH 2/2] Refactor #5257 --- components/lib/basecomponent/BaseComponent.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index eb3ede7bc..6b2412243 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -270,7 +270,11 @@ export default { // $attrs without `pt:*` return Object.entries(this.$attrs || {}) .filter(([key]) => !key?.startsWith('pt:')) - .reduce((acc, [key, value]) => (acc[key] = value) && acc, {}); + .reduce((acc, [key, value]) => { + acc[key] = value; + + return acc; + }, {}); } } };