[Vuejs]-New issue after refactoring my code: "Invalid prop: type check failed for prop"

0👍

I’m still not sure why this is happening all of a sudden, but I was able to figure out a way around it. Originally I was declaring my props like this:

import { Vue, Component, Prop } from 'vue-property-decorator';

@Component({})
export default class Pagination extends Vue {

    @Prop()
    public pager: Pager;

}

I got it to work by defining the type like this

import { Vue, Component, Prop } from 'vue-property-decorator';
import { PropType } from 'vue';

@Component({})
export default class Pagination extends Vue {

    @Prop({ type: Object as PropType<Pager> })
    public pager: Pager;

}

Leave a comment