Skip to content

Different behaviors of Arrow function and function  #9707

Closed
@zhangenming

Description

@zhangenming

Version

2.6.8

Reproduction link

https://codepen.io/zhangenming/pen/GexZQK

Steps to reproduce

    <input :value="price" @input="e=>price=e.target.value">

Compiled:

    with(this){return _c('input',{domProps:{"value":price},on:{"input":e=>price=e.target.value}})}
    <input :value="price" @input="function f(e){price=e.target.value}">// this wont' be work

Compiled:

    with(this){return _c('input',{domProps:{"value":price},on:{"input":function($event){function f(e){price=e.target.value}}}})}

What is expected?

can be work

What is actually happening?

this wont' be work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions