Skip to content

v-bind property value shorthand #83

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy