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

Vee-validate with vue wrapper component select2 (3rd party jquery plugin) not working #590

Closed
PrtsJonathan opened this issue Jun 22, 2017 · 6 comments
Labels
❔ question More of an inquiry than an issue

Comments

@PrtsJonathan
Copy link

PrtsJonathan commented Jun 22, 2017

Versions:

  • VueJs: 2.1.10
  • Vee-Validate: 2.0.0-rc.5

Description:

Hi, I'm having some trouble with vee-validate.. with select2 plugin from wrapper component..
no error were found in console, but the validation is not working.

Link source from : https://vuejs.org/v2/examples/select2.html
Any help would be much appreciated.. Thanks.

note: I've tried vue-select by sagalbot before and it's working greatly with vee-validate, but it's not really flexible as i thought, so i changed it back to select2 jquery..

Steps To Reproduce:

This code is not working : (using select2)

<select2 name="user" data-vv-name="user" v-validate="'required'" :options="options" v-model="selected">
 </select2>
<span v-show="errors.has('user')" class="help is-danger">{{ errors.first('user') }}</span>

This code is working : (using vue-select)

<v-select name="user" data-vv-name="user" v-validate="'required'"  v-model="selected" :options="options"></v-select>
<span v-show="errors.has('user')" class="help is-danger">{{ errors.first('user') }}</span>

@logaretm
Copy link
Owner

I guess it has to do with emitted events, I will take a look when I can.

@logaretm logaretm added the ❔ question More of an inquiry than an issue label Jul 6, 2017
@logaretm
Copy link
Owner

logaretm commented Jul 6, 2017

Here you go, sorry it took some time:

I used the official select2 example and extended upon it:
https://jsfiddle.net/logaretm/fruqrvdL/831/

Note that I applied a data-vv-name attribute and the directive v-validate on the component in the demo template and not the component template.

@logaretm logaretm closed this as completed Jul 6, 2017
@PrtsJonathan
Copy link
Author

Hi, thanks for the effort. I've solved mine also by yesterday, and came up with the same solution as yours, it's working great. Have a good day Sir. 👍

@bakumn
Copy link

bakumn commented Jan 8, 2019

hello how to solved. pls share.

@chugas
Copy link

chugas commented Mar 21, 2019

Hi, how did you solve the problem with your custom wrapper ?

@tsulatsitamim
Copy link

tsulatsitamim commented May 16, 2020

Hi, how did you solve the problem with your custom wrapper ?

how I manage using vue-bootstrap
https://gist.github.com/tsulatsitamim/a073d159bd715d13a5b18497e22a02af

it support ajax or local data by providing url or items props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔ question More of an inquiry than an issue
Projects
None yet
Development

No branches or pull requests

5 participants