Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to "maxlength" in this component? #52

Open
bgoncal opened this issue Mar 16, 2018 · 7 comments
Open

How to "maxlength" in this component? #52

bgoncal opened this issue Mar 16, 2018 · 7 comments

Comments

@bgoncal
Copy link

bgoncal commented Mar 16, 2018

No description provided.

@paulpv
Copy link

paulpv commented Apr 3, 2018

Ditto. Dealbreaker without ability to define max value. :/

@paulpv
Copy link

paulpv commented Apr 4, 2018

Would be nice if they would merge #36!

@luccasparoni
Copy link

I'm having this issue too, anyone know how to limit v-money component?

@betonix
Copy link

betonix commented Jul 23, 2019

you can put "maxlength" on object money, and works. but you have to put one more, because of the comma.
money: { decimal: ',', thousands: '.', suffix: '', precision: 2, maxlength: 6, masked: false },

@matheushf
Copy link

Workaround is to wrapp it in another component and use this:

methods: {
    calcMaxLength(value) {
      if (parseFloat(value) === 0) {
        this.setMaxLength(2);
      } else {
        this.setMaxLength(1);
      }
    },
    setMaxLength(extraChar) {
      this.maxLength = this.integerPlaces + this.decimalPlaces + extraChar;
    },
   
  },

Call calcMaxLength on your input event

@lndr-ssantos
Copy link

lndr-ssantos commented Feb 18, 2020

you can put "maxlength" on object money, and works. but you have to put one more, because of the comma.

Thank you, @betonix ! Help me a lot!

@jonathanpmartins
Copy link

hey,
Unfortunately I don't think support will come soon. This repo seems to be abandoned! I decided to upgrade this package to be used with Vue3.

Welcome v-money3!

v-money3 has the max attribute that takes care of maximum user inputs. Feel free to test it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants