v-money
v-money copied to clipboard
Block Negative Numbers
Hello! How i block negative numbers?
Seems like downgrade to 0.7 is the only way to now
You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:
@keydown="$event.key === '-' ? $event.preventDefault() : null"
still relevant in 2021
hey @ortonomy, 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
!
I'm interested to maintain v-money3
for vue 3 and beyond.
Negatives numbers can be blocked using the disable-negative
property on the component. Feel free try it out!
Open a issue there if requirements don't meet your expectations.
You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:
@keydown="$event.key === '-' ? $event.preventDefault() : null"
This can lead to false validation cause you can copy/paste a negative value
You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:
@keydown="$event.key === '-' ? $event.preventDefault() : null"
This can lead to false validation cause you can copy/paste a negative value
I used this and it disallows copy and pasting
@copy.prevent
@paste.prevent