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 in v-money component validate with vee-validate #92

Open
PetroGromovo opened this issue Dec 22, 2019 · 4 comments
Open

How in v-money component validate with vee-validate #92

PetroGromovo opened this issue Dec 22, 2019 · 4 comments

Comments

@PetroGromovo
Copy link

Hello,
I use v-money component
on the form when I use vee-validate for data validation and the problem is that I can not make money conponent be validated :
I make as :

<ValidationProvider
      name="price"
      :rules="{ required : true, min:0.01 }"
      v-slot="{ errors }"
>
   <money
         v-model="taskRow.price"
         v-bind="moneyConfig"
         name="price"
         id="price"
         class="form-control text-right"
         placeholder="Enter price"
   >

   </money>
   <p class="validation_error">{{ clearErrorMessage(errors[0]) }}</p>
</ValidationProvider>
...

    import {Money} from 'v-money'    // https://github.com/vuejs-tips/v-money

...

        data() {
            return {
                taskRow: {
                    price: 0,
                    ...
                },
        ...

        components: {
            Money,
        },


                moneyConfig: {
                    decimal: ',',
                    thousands: '.',
                    prefix: '$',
                    suffix: '',
                    precision: 2,
                    masked: false
                },



```I set 2 conditions in ValidationProvider for money control, but none of them is triggered  for default 0 value,
which I condsider as invalid.
If there is a way ?


@vue/cli 4.0.5
"v-money": "^0.8.1",
"vee-validate": "^3.1.0",
"vue": "^2.6.10",

Thanks!
@belovolalex
Copy link

I have same issue!

@fdorantesm
Copy link

I have same issue!

That seems that we need to fix it and make PR.

@igorgoncalves
Copy link

I have same issue T.T

@igorgoncalves
Copy link

Work's for me with the directive:

<b-input
     v-model.lazy="innerValue"
     v-money
     v-bind="$attrs"
     :size="size"
     :max="max"
     :type="type"
     :inputmode="inputmode"
     data-vv-delay="500"
     @blur="onBlur"
   ></b-input>

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

4 participants