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

Importing interfaces for vee-validate/rules #4971

Open
ats-shublaq opened this issue Jan 10, 2025 · 0 comments
Open

Importing interfaces for vee-validate/rules #4971

ats-shublaq opened this issue Jan 10, 2025 · 0 comments

Comments

@ats-shublaq
Copy link

ats-shublaq commented Jan 10, 2025

What happened?

I'm trying to build a dynamic form generator, using vee-validate, vee-validate/rules along side with vuetify-nuxt

I'm doing my best to restrict any generic or random rules, and stay committed only to the rules that vee-validate/rules provides.

so during my schema building for my generator, I reached out to this point

`import type { VCol } from 'vuetify/components';
import type { all } from '@vee-validate/rules';

interface FieldConfig {
is: 'textField' | 'textArea' | 'select' | 'checkbox' | 'slot';
type?: 'text' | 'number' | 'password';
name: string;
label: string;
rules?: Record<keyof typeof all, any>;
cols?: Partial ;
}

export const schema: FieldConfig[] = [
{
is: 'VTextField',
type: 'text',
name: 'username',
label: 'username',
rules: {
required: true,
invalidRandomRuleThatShouldTriggerError: 'wefwef',
min: 3,
},
cols: {
md: 12,
},
},
];
`

I expect when defining the "rules" the autocomplet should be working fine and listing all the vee validate rules, also when writing any non-existing rules, the eslint must trigger an error. but both of these expectations not working

Vue.js 3.x and vee-validate 4.x

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

No branches or pull requests

1 participant