v-bind modifiers

I know this is not code related problem but i want to know, how to use or when to use the v-bind modifiers .camel, .prop, .attr. I am still confuse about it Can y'all provide example code of it
1 Reply
Jochem
Jochem8mo ago
the docs have some examples: https://vuejs.org/api/built-in-directives.html#v-bind and a short explanation:
When setting a binding on an element, Vue by default checks whether the element has the key defined as a property using an in operator check. If the property is defined, Vue will set the value as a DOM property instead of an attribute. This should work in most cases, but you can override this behavior by explicitly using .prop or .attr modifiers. This is sometimes necessary, especially when working with custom elements.
And for .camel
The .camel modifier allows camelizing a v-bind attribute name when using in-DOM templates, e.g. the SVG viewBox attribute: <svg :view-box.camel="viewBox"></svg>
Vue.js
Vue.js - The Progressive JavaScript Framework
Want results from more Discord servers?
Add your server