Open leok85 opened 7 years ago
The problem happens when the data is of the type string. The library works correctly when the data is of type number.
It would be good to work in both situations.
Even if it's a number, didn't work for me @renatosistemasvc
Here's a reproduction https://stackblitz.com/edit/js-ueo8am?file=index.js
I'm using the component:
<money v-model="price" v-bind="money"></money>
Instead of:
<input v-model.lazy="price" v-money="money" />
@renatosistemasvc So are the directive and and the component supposed to function differently? Either way, it seems the issue isn't with the component but rather with the directive.
@eternalcode0 Yes! There is a bug in the directive. But if you use the direct component, the problem is solved. The component also uses the directive internally. But for some reason, using the component directly makes the problem go away.
I'm using it in my projects and it's working fine. I downloaded the src folder from this repository and adapted the library to work with null values and with vue element.
everything works fine!
If I start the component with an integer value, for example 50, it should interpret it as number 50.00, but with the mask the input number stays as 0.50
You can reproduce the problem by paste the number 50 https://vuejs-tips.github.io/v-money/
*sorry my english