Vasu Mistry
Vasu Mistry

Reputation: 841

Understanding how to avoid vue/require-prop-type-constructor warning in VueJS

I am controlling a Tabview with a boolean variable isTabsEnabled to toggle displaying of tabs. This prop is passed as child to the screens using it, this is the parent file,

export{
  props:{
    isTabsEnabled: true
  }
}

ESLint throws the error vue/require-prop-type-constructor, I tried using propsData, this removes the warning message, but the functionality breaks.

Any suggestion on how can I avoid this warning?

Upvotes: 8

Views: 12876

Answers (1)

Decade Moon
Decade Moon

Reputation: 34286

You need to specify the prop type:

props: {
  isTabsEnabled: {
    type: Boolean,
    default: true
  }
}

Upvotes: 23

Related Questions