-
Notifications
You must be signed in to change notification settings - Fork 538
v-bind .prop shorthand proposal #18
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
Conversation
|
If |
|
.inner-html - it's mentioned in the rfc |
|
So |
|
@donnysim AFAIK, there are only 2 NOT read-only props that not strictly follow the camel-case rules. |
|
@troy351 I know, that's just a question on implementation 🤷 |
|
@donnysim I think just add additional check for these two props as an exception |
|
I'm favorable to the shorthand. It remembers me lit-html. I'm neutral to |
|
I like the deprecation of v-text and v-html to simplify the API. As an alternative to a shorthand though, I wonder if it might be better to use the same behavior as Svelte, assigning to a DOM property if one exists and falling back to an attribute otherwise. Then we'd achieve as brief a syntax as this shorthand while further simplifying the API to deprecate the I can't immediately think of any edge cases and couldn't find any open issues for Svelte reporting any. Is this potentially feasible? |
|
@chrisvfritz I think that's worth trying, I'm mostly concerned with potential behavior differences from how Vue handles it now. Would need some testing in real world use cases. |
|
@yyx990803 Perhaps as an interim step, detected DOM properties could not only have the DOM property set, but also get added as an attribute, as happens now. That way, if someone is relying on the attribute existing (e.g. using a |
|
Closing since this is technically no longer needed in Vue 3 - if a property with the same name exists on the target DOM node, it will automatically be bound as a prop. |
Rendered