oruga icon indicating copy to clipboard operation
oruga copied to clipboard

v-model modifier on input ruins html

Open AuthorProxy opened this issue 2 years ago • 3 comments

Overview of the problem Oruga version: [0.6.0] Vuejs version: [3.2.47] OS/Browser:

Description trim modifier adds ugly modelmodifiers="[object Object]" to the final html: <o-input v-model.trim="test_model.property" name="test_name" />

AuthorProxy avatar Nov 11 '23 00:11 AuthorProxy

@AuthorProxy I think v-model modifiers only work when used directly on an html input element. However, oruga components are just normal vue components. I don't know if v-model modifiers are also usable for components v-model. Do you have an example?

mlmoravek avatar Dec 16 '23 13:12 mlmoravek

I don't think that the built-in v-model modifiers automatically work on anything but plain HTML elements, but it is possible to get the set of modifiers used on a custom component and define one's own behavior to handle them.

blm768 avatar Feb 06 '24 20:02 blm768

@mlmoravek we can just omit them - so they not ruin final html

AuthorProxy avatar Feb 09 '24 19:02 AuthorProxy