Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Manually trigger validations #150

Closed
Almis90 opened this issue Jan 30, 2016 · 3 comments
Closed

Manually trigger validations #150

Almis90 opened this issue Jan 30, 2016 · 3 comments

Comments

@Almis90
Copy link

Almis90 commented Jan 30, 2016

I have custom validation

uniqueUsername: function (val) {
    return !this.usernameExists;
}

and a method

usernameKeyup: function () {
    var self = this;
    Vue.http.post('/username', { username: this.username }).then(function (res) {
        if (res.data.success) {
            self.usernameExists = res.data.object;
        }
    }).catch(function (res) {
        console.log(res);
    });
}

When the usernameExists changes the validation is not re-evaluating, only when I go to next input it shows the correct validation. Is there any way that I could manually re-evaluate for single input?

@kazupon
Copy link
Owner

kazupon commented Jan 31, 2016

Currently, vue-validator cannot the re-evaluate for single input manually.
I'll try to consider it. 😺

@Almis90
Copy link
Author

Almis90 commented Jan 31, 2016

Hey can you explain me please how I can now manually re-evaluate with your latest code change now?

@kazupon kazupon reopened this Feb 2, 2016
@kazupon
Copy link
Owner

kazupon commented Feb 2, 2016

Sorry.
It was not over yet.

To resolve this issue, We need to improve the vue.js
I push the PullRequest to vuejs/vue repositry, I'm waiting the it.

vuejs/vue#2272

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

No branches or pull requests

2 participants