-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New prop shorthand #5835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you're using ES6 already (via webpack's vue-loader), you can try |
Quoting Evan from #2877:
@maurop123 Do you have any arguments against the issues Evan raised? If not, I would close this feature request as a duplicate. Also, @sirlancelot mentioned a nice "workaround" to make something like this possible with the current API. |
Thank @sirlancelot for the approach. I just tried it and it works great. @LinusBorg I do agree with Evan's argument. Thank you for bringing it up. I'll close it now 👍 |
What problem does this feature solve?
When passing props to a component, the following pattern is very common,
<my-component :propA="propA" :propB="propB" />
I am proposing that when the prop name is the same as the variable name being passed to it, that the following more concise syntax be applicable,
<my-component :propA :propB :propC />
This would mimic ES6's object property declaring shorthands (like here http://www.benmvp.com/learning-es6-enhanced-object-literals/)
What does the proposed API look like?
<my-component :propA :propB :propC />
instead of
<my-component :propA="propA" :propB="propB" />
The text was updated successfully, but these errors were encountered: