Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v1.2.0

@AlexandreBonneau AlexandreBonneau tagged this 27 Mar 21:21
In `v1.1.*`, whenever the options were changed, the number of decimal places for the `rawValue` was calculated based of the previous options, and not only the new given options.
This was useful when two vue-autonumeric components shared the same v-model, but different options that have different values for the `rawValue` decimal places count.

For instance if one of the `vue-autonumeric` component had a `decimalPlaces` option set to `2`, and another set to `5`, then when the user modified the value of one of those components, vue-autonumeric would detect a programmatic value change in the other component (since it did not come from a user interaction), and it would then use `set()` to set the new value.
The first component would drop the additional decimal places when using `set()`...which in turn would make the other components aware of that new value change, and the second component would then use that new cropped value as well.

However, this special decimal places management is complexifying the code quite a bit, and is not 100% effective since some use cases were difficult, if even possible, to manage.
This `rawValueDecimalPlaces` *hack* is now reverted to a more sane and legible code.

From now on, the user will have to explicitly declare the `rawValueDecimalPlaces` value when updating the options, if he does not want to lose the precision when switching options.

Signed-off-by: Alexandre Bonneau <[email protected]>
Assets 2
Loading