Skip to content

"Attributes shorthand" in v-for cycles #11859

@ghost

Description

What problem does this feature solve?

Vue is famous for its highly readable syntax and this can make it even more readable.

What does the proposed API look like?

Instead of writing duplicities in v-for cycles like this:

<elm
v-for="({ value, class, 'data-image' }, key) in elmprops"
:value="value"
:class="class"
:data-image="data-image"
:key="key"
/>

Would by nice to have "attributes shorthand" like this:

<elm
v-for="({ value, class, 'data-image' }, key) in elmprops"
:value
:class
:data-image
:key
/>

Like the object properties shorthand works in ES:

let routes = []
let router = { routes }

instead of unnecessary duplicities in older syntax:

let routes = []
let router = { routes: routes }

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