Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vue.js

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?

like image 657
Vasu Mistry Avatar asked Dec 03 '22 19:12

Vasu Mistry


1 Answers

You need to specify the prop type:

props: {
  isTabsEnabled: {
    type: Boolean,
    default: true
  }
}
like image 91
Decade Moon Avatar answered May 29 '23 04:05

Decade Moon