phiny1 / v-currency-field

The Vuetify Currency Field uses Vue Currency Input directive to create a currency component (<v-currency-field>)
https://phiny1.github.io/v-currency-field/
MIT License
60 stars 29 forks source link

Not reactive when using as directive with vuetify #11

Closed paulodiogo closed 5 years ago

paulodiogo commented 5 years ago

I'm trying to use the component as a directive, but seems that the vuetify lose the reactivity when used with v-currency. I need to update several other fields when one value changes.

https://codepen.io/paulodiogo/pen/rNNLQQw?editors=1010

phiny1 commented 5 years ago

The directive v-currency comes from v-money for Vue. It needs to be put in INPUT tag, thats not occurs when you put the directive to v-text-field from vuetify.

The component create a child INPUT and the directive stay in the wrong tag. Thats why will not work.

I create the component v-currency-field to the directive works with v-text-field. You should use v-currency-field instead of v-text-field.

Why do you need use directive in v-text-field instead use v-currency-field component?

phiny1 commented 5 years ago

@paulodiogo With directive will not work.. you can use like a component:

https://codepen.io/phiny1/pen/NWWrmma?editors=1111

paulodiogo commented 5 years ago

@phiny1 the allowBlank option is working for you?

Why do you need use directive in v-text-field instead use v-currency-field component?

I just need the directive right now, but I'm open to use the component, but the allowBlank does not work now... =[

Thank you for the feedback!