Skip to content

Enhance v-bind with shorthand for values matching property name #8914

Closed
@dgirgenti

Description

@dgirgenti

What problem does this feature solve?

I often find myself passing bound properties into components that are identical to some computed or data property on my current Component. In cases where a bound property's value is equivalent to the property name, it would be nice to not have to repeat the property name.

This would feel familiar to the es6 object shorthand notation which allows you to leave out values that are the same as the property name.

It can also apply and will feel familiar to attributes that commonly do not include values, like an input's checked attribute.

What does the proposed API look like?

An example can be found here: https://codepen.io/anon/pen/dgNBQK

Essentially,
<SomeComponent :someProperty="someProperty" />
would become
<SomeComponent :someProperty />

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