Skip to content

v-bind.sync listens for camelCase event #6428

Closed
@sirlancelot

Description

@sirlancelot

What problem does this feature solve?

This markup:

<component :max-items.sync="showItems"></component>

Currently compiles to:

function render() {
    with(this) {
        return _c('component', {
            attrs: {
                "max-items": showItems
            },
            on: {
                "update:maxItems": function($event) {
                    showItems = $event
                }
            }
        })
    }
}

I've always written event handlers in kebab-case. It surprised me that the compiler created an event handler which is in camelCase.

What does the proposed API look like?

The compiler should output .sync event handlers in camelCase:

            on: {
                "update:max-items": function($event) {
                    showItems = $event
                }
            }

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