Element: [Bug Report] el-radio-group don't work properly when using value property and @change event

Created on 19 Feb 2020  ·  3Comments  ·  Source: ElemeFE/element

Element UI version

2.13.0

OS/Browsers version

Chrome 79 / Ubuntu 19.04

Vue version

2.6.11

Reproduction Link

https://codepen.io/raikel/pen/ZEGpObw?editors=1000

Steps to reproduce

Set :value="value" and @change="val => value = val" on an el-radio-group component with a value data.

What is Expected?

To be able to select a radio group item

What is actually happening?

Unable to select any radio group item

May be related to #18852. I think this a serious issue. I am unable to make my component's data to get synced with store data because these issues. Even more, this is the "Vuex way" to form handing to keep component data synced with store data, as pointed here:

<input :value="message" @input="updateMessage">

Most helpful comment

@raikel It is a bug, why not fix it ?

All 3 comments

Got the same issue.

When selecting other option value passed onChange event is the same as the selected one.

UPDATE: using v-model together with @change seems to be working.

Instead to using the @change event, you must use the @input event for this to work. Although the @input event is not listed in the events section of the docs for this component, the @input event must exist for a components that implements the v-model api. Working sample here

@raikel It is a bug, why not fix it ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhguokai picture zhguokai  ·  3Comments

yorululu picture yorululu  ·  3Comments

Kingwl picture Kingwl  ·  3Comments

yuchonghua picture yuchonghua  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments