jonathanpmartins / v-money3

Vue3 currency input/directive mask
MIT License
103 stars 27 forks source link

vue3 directive not working #17

Closed yogesh-gohil closed 3 years ago

yogesh-gohil commented 3 years ago

I have created the v-money3 directive and use it on the input element but its not reactive its give bellow error on console

Screenshot 2021-06-11 at 10 07 57 AM

jonathanpmartins commented 3 years ago

@yogesh-gohil

Would be nice to have more information about the problem. I could not find it! Can you elaborate a codesandbox example?

This is a working example of directive usage.

<input v-model.lazy="amount" v-money3="config" />
import { Money3Directive } from "v-money3";
export default {
  data() {
    return {
      amount: 0,
    };
  },
  computed: {
    config() {
      return {
        decimal: ",",
        thousands: ".",
        prefix: "R$ ",
        suffix: "",
        precision: 2,
        masked: false /* doesn't work with directive */,
      };
    },
  },
  directives: {
    money3: Money3Directive,
  },
};
jonathanpmartins commented 3 years ago

Hey, @yogesh-gohil. Could you please update to the last 3.13.6 version and test if your problem persists? I made a fix for a problem that was happening if you initialized the component using a null value for v-model.

jonathanpmartins commented 3 years ago

closed by user timeout

jonathanpmartins commented 3 years ago

https://github.com/jonathanpmartins/v-money3/issues/19 Could this be related @yogesh-gohil @botura ?

botura commented 3 years ago

Probably yes, errors seen to be the same.