Closed
Description
Let's say you have the following template:
<vue-autonumeric
:options="obj.options"
v-model="obj.val"
/>
If you want to modify both :value
and :options
props at the same time, you would proceed by doing:
this.obj = {
options : 'percentageEU3dec',
val : 0.00123456,
};
However since the initial default options here sets the decimalPlaces
option to 2
, then if the value
is modified first, then AutoNumeric will (rightly) drop any additional decimal places and keep only 0.00
, instead of 0.00123456
.
For this to work, we need to find a reliable way for the VueAutonumeric
component to first update the options
before the value
.
That way 'percentageEU3dec'
will correctly update decimalPlaces
to 5
, and then 0.00123
will correctly be saved as the value
.
You can see the problem on this codepen.