Weird v-bind attribute merging
See original GitHub issueVersion
2.6.11
Reproduction link
https://codepen.io/wenfang/pen/VwaeOxW?editors=1111
Steps to reproduce
None
What is expected?
Since v-bind="{ foo: 'baz' }"
is written after foo="bar"
, I expected the final DOM div has foo="baz"
What is actually happening?
The DOM div has foo="bar"
, is this intended?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
v-bind Merge Behavior breaking - Vue 3 Migration Guide
When dynamically binding attributes on an element, a common scenario involves using both the v-bind="object" syntax as well as individual attributes in the ......
Read more >How can I solve "Interpolation inside attributes has been ...
Use v-bind or shortcut syntax ':' to bind the attribute. Example: <input v-bind:placeholder="title"> <input :placeholder="title">.
Read more ><component> is not replaced when using v-bind={is - GitHub
Replacement can only work reliably if the presence of the is attribute is guaranteed. That is not the case when you are using...
Read more >v-bind Merge Behavior - Vue.js
When dynamically binding attributes on an element, a common scenario involves using both the v-bind="object" syntax as well as individual ...
Read more >Vue.js and HTML5 contenteditable attribute gotchas
Let's combine this feature with Vue.js application and provide a editable field with colored texts. HTML; CSS; JS.
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 Free
Top 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
Style and class have different behavior as the merge properties and dynamic ones have higher priority
I believe single attribute takes higher priority than the
v-bind
object binding. As it’s more specific.