From 1e44f356b3c0825cd58f14baf2706a64f160a66d Mon Sep 17 00:00:00 2001 From: Xc <124118265@qq.com> Date: Wed, 6 Jul 2022 23:08:04 +0800 Subject: [PATCH] Revert "fix(components): [radio] Divide attrs into label and input (#8476)" This reverts commit 2d8a9e4256385573e10357d19d0a83e07e30c24a. --- .../components/radio/__tests__/radio.test.tsx | 50 ------------------- packages/components/radio/src/radio.vue | 20 +------- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/packages/components/radio/__tests__/radio.test.tsx b/packages/components/radio/__tests__/radio.test.tsx index a7364fb7feccf..04a4a93e9694a 100644 --- a/packages/components/radio/__tests__/radio.test.tsx +++ b/packages/components/radio/__tests__/radio.test.tsx @@ -373,54 +373,4 @@ describe('Radio Button', () => { expect(radioGroup2.attributes()['aria-labelledby']).toBeFalsy() }) }) - - describe('laebl for', () => { - test('label and radio', async () => { - const radio = ref('') - const forId = ref('radio1121') - const wrapper = mount(() => ( - <> - - - - )) - await nextTick() - const label = wrapper.find('label') - label.trigger('click') - expect(radio.value).toBe('Foo') - // no for - radio.value = '' - forId.value = undefined - await nextTick() - label.trigger('click') - expect(radio.value).toBe('') - }) - - test('label and radioGroup', async () => { - const compList = [Radio] - compList.forEach(async (comp) => { - const radio = ref('') - const forId = ref('radio1121') - const wrapper = mount(() => ( - <> - - - - - - - )) - await nextTick() - const label = wrapper.find('label') - label.trigger('click') - expect(radio.value).toBe('Foo') - // no for - radio.value = '' - forId.value = undefined - await nextTick() - label.trigger('click') - expect(radio.value).toBe('') - }) - }) - }) }) diff --git a/packages/components/radio/src/radio.vue b/packages/components/radio/src/radio.vue index 25cc895f44fca..9a1368114e10f 100644 --- a/packages/components/radio/src/radio.vue +++ b/packages/components/radio/src/radio.vue @@ -7,10 +7,7 @@ ns.is('bordered', border), ns.is('checked', modelValue === label), ns.m(size), - rawAttrs.class, ]" - :style="containerStyle" - v-bind="labelListieners" >