9

I want give the validation in vuejs for that i am using vee-validate

  • My vue js version is 2.6.10
  • And install run -npm install vee-validate

I declare in main.ts:

import  VeeValidate  from "vee-validate";
Vue.use(VeeValidate);

But having error:

"export 'default' (imported as 'VeeValidate') was not found in 'vee-validate'

And also on console:

Cannot read property 'install' of undefined at Function.Vue.use

4 Answers 4

21
import * as VeeValidate from 'vee-validate';

that resolve the problem

Sign up to request clarification or add additional context in comments.

2 Comments

This should be marked as correct answer. It has solved my problem.Thanks
You should make use of tree shaking to remove redundant imports at compile time by using object destructuring syntax.
9

this seems to happen in any version after 3.0. I installed [email protected] and it worked.

Comments

2

Since the newsest release, it's name had changed, now if you want to call it, and you register it :

import { ValidationProvider } from 'vee-validate';

// Register it globally
// main.js or any entry file.
Vue.component('ValidationProvider', ValidationProvider);

Of course, you can check the Npm package documentation on : https://www.npmjs.com/package/vee-validate

Comments

0

To install it, Run

npm i vee-validate --save

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.