Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

nuxt.js - How to install and configure vee-validate (v4) in nuxt?

I'm having a hard time understanding the docs to install this awesome plugin in to nuxt. From what I understand, which I find hard to believe, you have to export all of the rules in a plugin file. I tried to export some of the rules, but nuxt didn't know what the ValidationObserver component was.

question from:https://stackoverflow.com/questions/65940703/how-to-install-and-configure-vee-validate-v4-in-nuxt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

VeeValidate v4 is not compatible with Vue 2.x, and that means it won't work with Nuxt 2.x as vee-validate (v4) is only targeting Vue 3 support.

Generally, with vee-validate v3 you do need to register your rules in a plugin file, and register the validation-observer and validation-provider globally or import them when needed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...