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

(Vue 2.6 + Composition Api) useVuelidate() stops all returned setup() data from being referenced in the template? #963

Closed
tleytek opened this issue Oct 29, 2021 · 4 comments · Fixed by #967

Comments

@tleytek
Copy link

tleytek commented Oct 29, 2021

Describe the bug
Once useVuelidate() is instantiated within setup(), all references to setup() return values don't exist in the template.

Reproduction URL
Vuelidate 2 - Composition API + Vue 2.6

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate useVuelidate() within setup()

Expected behavior
I should be able to reference v$ or any value's I am returning from setup() in the template

@dobromir-hristov
Copy link
Contributor

  • I am not sure i understand what the issue is. Your repro link looks alright.

@dobromir-hristov
Copy link
Contributor

Vuelidate has issues because of VueDemi in codesandbox.

Can you check this on your local?

@tleytek
Copy link
Author

tleytek commented Oct 29, 2021

Now it seems that calling useVuelidate() causes vue composition api to stop working in other components.

Github repo
Netlify deployment

For contrast, a vue 2.6 app and vue 3 app both implementing vuelidate validations using the composition API
Vue 2.6 + Vuelidate 2 (Using composition api)
Github repo
Netlify deploy

Vue 3 + Vuelidate 2 (Using composition api)
Github repo
Netlify deploy

@dobromir-hristov
Copy link
Contributor

This is a problem with the version of Vue-demi we have under the hood.

Changing the import to @vue/composition-api/dist/vue-composition-api.esm from @vue/composition-api fixes all the issues, but this is not OK.

I will try updating the deps as this might fix things - vueuse/vue-demi#105

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

Successfully merging a pull request may close this issue.

2 participants