Skip to content

RFC: shorthand props #164

Description

@zhiyuanzmj

Just like svelte has shorthand attributes

<img {src} />

And after vue3.4 also supported same-name shorthand.

<img :src />

Proposal

Shorthand props

So can we also support shorthand props like svelte:

<img {src} />

I know jsx can use {...{ src }} instead, but it's not beautiful for me.

I already created a plugin unplugin-jsx-short-bind to support it, because of TS, espree and babel don't support shorthand props, so I use ast-grep to parse ast.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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