Skip to content

When using an object to modify both the :value and :options props, the options is not always modified before the value #10

Closed
@AlexandreBonneau

Description

@AlexandreBonneau

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions