Described in rc15 is a way to import single rules to keep the build small. This doesn't seem to work.
Using the description given in the docs:
import Vue from 'vue';
import VeeValidate from 'vee-validate/dist/vee-validate.minimal';
import { Rules } from 'vee-validate';
Vue.use(VeeValidate);
// add the required rule
VeeValidate.Validator.extend('required', Rules.required);
I get this in the console:
"export 'Rules' was not found in 'vee-validate'
It could be that something in my code is wrong. I tried to find soem sort of export statement in the vee-validate.js which might export Rules in a way but couldn't find any. But that could also be caused by my misunderstanding of the codebase.
If this is working fine for anyone in here just close this issue please and I will dig into a bit more on my side.
Thanks for reporting this, This is a bug caused by Rules not being exported correctly by the plugin, Should be released in the next version. Sorry about that, I will release a quick fix today or tomorrow.
When are this fix planned to be deployed?
@vfportero this is already fixed, we are using it in our current project, see:
https://github.com/baianat/vee-validate/releases/tag/2.0.0-rc.18
@escapedcat I'm using typescript and the Rules object is not being declared on the vee-validate.d.ts file. The only way to make it work is using the Validator.rules object and making a cast:
(Validator.rules as any).email(value.trim()) //Validates the email trimmed
Most helpful comment
Thanks for reporting this, This is a bug caused by Rules not being exported correctly by the plugin, Should be released in the next version. Sorry about that, I will release a quick fix today or tomorrow.