Skip to content

v-bind property value shorthandΒ #83

Closed
@GavinRay97

Description

@GavinRay97

I have a working rough proof-of-concept here:
GavinRay97/vue@524d4c4

Allow binding property keys to values of the same name, the way that ES6 shorthand for object syntax works.

const a = 1
const b = 2

// Much more concise, especially when you have many entries
const obj = { a, b }

// Not DRY at all
const obj = { a: a, b: b }
<my-component :name :whatever>
// Translates to
<my-component :name="name" :whatever="whatever">

Inspired by this Twitter comment:

vuerfc

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