Skip to content

unexpected failure with v-model in some compiled codes before 2.5.0 #6803

@KagamiChan

Description

@KagamiChan

Version

2.5.0

Reproduction link

https://jsfiddle.net/skagami/b3tkrpmv/2/

Steps to reproduce

  • click on the radio element, and no console output
  • change vue version to 2.4.4, click on the radio again, and voila the console output

What is expected?

vue can handle the event on the input element

What is actually happening?

vue dose not handle this event


The render() part is modified from compiled code with [email protected] from element-ui's radio-button component

It seems that the compilation for v-model for this component has changed between [email protected] and [email protected]

consider a simplified template:

<input type="radio" v-model="value" :value="foobar" >

with [email protected] the output is:

render: 'with(this){return _c(\'input\',{directives:[{name:"model",rawName:"v-model",value:(value),expression:"value"}],attrs:{"type":"radio"},domProps:{"value":foobar,"checked":_q(value,foobar)},on:{"__c":function($event){value=foobar}}})}',

with [email protected], the event name changes:

render: 'with(this){return _c(\'input\',{directives:[{name:"model",rawName:"v-model",value:(value),expression:"value"}],attrs:{"type":"radio"},domProps:{"value":foobar,"checked":_q(value,foobar)},on:{"change":function($event){value=foobar}}})}',

I don't know if this is a feature, or the template is not correctly written.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions