Open VDVT opened 2 years ago
Same here
I was getting this too, in Nuxt if you are using an ES6 library, it needs to be transpiled first. Add this to your nuxt.config
build: {
transpile: ['vuelidate-property-decorators']
},
Additional tip: If you don't want to make a Nuxt plugin for global use, be sure to extend the component with the mixins helper i.e.
import { Vue, Component, mixins } from 'nuxt-property-decorator';
import { validationMixin } from 'vuelidate';
import { Validations } from 'vuelidate-property-decorators';
import { required, minLength, between } from 'vuelidate/lib/validators';
@Component
export default class Login extends mixins(validationMixin) {
name = '';
age = 0;
//
@Validations()
validations = {
name: {
required,
minLength: minLength(4),
},
age: {
between: between(20, 30),
},
};
}
I got an issue when loading components in nuxtjs with mode SSR. Please see attachment