Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
refactor(box): change vee-valide auto import names
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Mar 11, 2024
1 parent bb6b8c4 commit 975363c
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions packages/nuxt/src/runtime/modules/box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,26 @@ export default definePergelModule<BoxOptions, ResolvedBoxOptions>({
],
})

const veeValidateComponents = [
'Field',
'Form',
'ErrorMessage',
'FieldArray',
]

veeValidateComponents.forEach((component) => {
addComponent({
name: `Vee${component}`,
export: component,
filePath: 'vee-validate',
})
useNuxtImports(nuxt, {
presets: [
{
imports: [
'Form',
'ErrorMessage',
{
name: 'FieldArray',
as: 'FormFieldArray',
from: 'vee-validate',
},
{
name: 'Field',
as: 'FormField',
from: 'vee-validate',
},
],
from: 'vee-validate',
},
],
})

useNuxtImports(nuxt, {
Expand Down

0 comments on commit 975363c

Please sign in to comment.