v-bind shorthand for equal property and attribute name
See original GitHub issueWhat problem does this feature solve?
Sometimes we’re binding attributes to the props that have exactly the same name. So we could simplify v-bind:attr="attr"
or :attr="attr"
to just this: :attr
.
What does the proposed API look like?
<Component :attr />
Equals to
<Component :attr="attr" />
Equals to
<Component v-bind:attr="attr" />
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Shorthand for `v-bind` in case when child component property ...
There is no shorthand in Vue for that. But, you can pass an object to v-bind and use the ES2015 property name shorthand:...
Read more >vue/prefer-true-attribute-shorthand
Rule Details #. v-bind attribute with true value usually can be written in shorthand form. This can reduce verbosity.
Read more >Binding syntax - Angular
Angular binding distinguishes between HTML attributes and DOM properties. ... other than interpolation have a target name to the left of the equal...
Read more >What you should know about Vue v-model - LearnVue
Vue v-model is a directive that creates a two-way data binding between a value in our template and a value in our data...
Read more >Attributes - C# language specification | Microsoft Learn
Each non-static public read-write field and property for an attribute class defines a named parameter for the attribute class.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With ES6 syntax, you can write:
That’s equivalent to:
More details on Vue API docs.
@leopiccionia can you handle camelcase to kebabcase conversion automatically ?