TobyMosque / app-extension-qdecimal

QDecimal
16 stars 3 forks source link

[Enhancement] keep model value with the raw value #2

Closed eduardodgarciac closed 5 years ago

eduardodgarciac commented 5 years ago

When using ',' as decimal separator, could be good if the model can keep '.' as decimal separator because 1,1 is not a number in javascript, you have to handle it as string. Something like the existing "unmasked-value" prop.

TobyMosque commented 5 years ago

image QDecimal value must be a number, internally the component will parses that to a string before display it, and will parsed back when occurs a input event.

eduardodgarciac commented 5 years ago

Checking again, I noticed the error occurs using rules.

If you add a rule like :rules="[v => v > 0 || 'error']" will return "error" because is comparing against a string.

For example, this is my case. <q-decimal lang="es" :places="10" :precision="3" :step="1" label="N°" :rules="[v => v > 0 || 'error']" v-model="n"/>

TobyMosque commented 5 years ago

do you can update to beta.0 and try again? image

eduardodgarciac commented 5 years ago

Now is working, thank you!!