You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the docs state that you shouldn't wire value into :model-value, but instead use v-bind="field":
value: unknown
The current value of the field, useful to compare and do conditional rendering based on the field value. You should not use it as a target of v-model or :value binding. Instead use the field prop.
On the other hand, InputNumber expects to use v-model, so that doesn't work.
My question is whether the docs are correct? If so, what's the Right Way™ to do it? What are the pitfalls of using value this way?
There is a section on using v-model on the entire field. However, I don't want to bind the field to some external ref, I'm just trying to get the basic functionality to work with <InputNumber> instead of a plain <input>.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the numeric field
countof a model that I'm building in aFormcomponent. The field is rendered as a PrimeVueInputNumber.I have the following solution, which seems to work just fine:
However, the docs state that you shouldn't wire
valueinto:model-value, but instead usev-bind="field":On the other hand,
InputNumberexpects to usev-model, so that doesn't work.My question is whether the docs are correct? If so, what's the Right Way™ to do it? What are the pitfalls of using
valuethis way?There is a section on using
v-modelon the entire field. However, I don't want to bind the field to some externalref, I'm just trying to get the basic functionality to work with<InputNumber>instead of a plain<input>.Beta Was this translation helpful? Give feedback.
All reactions