dwol
Dynamic Nuxt Form Validation
We have something similar but we use zod with the :schema prop on UForm. For the schema the property is an array and you use the z.array(). I know that’s not super helpful because you are using a custom validate function but we’ve been pretty happy with zod so I think it’s something worth to look into
10 replies
How to prerender Nuxt Content when ssr is disabled?
The only way I’ve found to reliably do this is with setting ssr to true. You can still run generate with ssr: true. There’s also the experimental/ client build config option but it doesn’t seem very reliable for me.
3 replies
@nuxtjs/i18n test errors
You need to create an i18n plugin for your tests. I have a mocks/i18n.ts
import { createI18n } from 'vue-i18n'
import en from '~/locales/en-CA'
import fr from '~/locales/fr-CA'
export const enI18n = createI18n({
legacy: false,
locale: 'en-CA',
messages: {
'en-CA': en
}
})
export const frI18n = createI18n({
legacy: false,
locale: 'fr-CA',
messages: {
'fr-CA': fr
}
})
export const randomI18n = createI18n({
legacy: false,
locale: 'ja',
messages: {
ja: en
}
})
Then import your i18n mock and use in your component:
const wrapper = await mountSuspended(MyComponent, {
global: {
plugins: [enI18n]
}
})
19 replies