VueJs warning: “Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value”.

If you get a "Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value" warning when working on your VueJs application, look at your code to see if you are manipulating the element’s state directly.
Not working:

<vs-tabs id="tabs" ref="tabs"> 
...............
data() {
return {
}
},
selectOperation()
{
this.$refs.tabs.value=1;
},

Working:

<vs-tabs id="tabs" ref="tabs" :value="currentTab"> 
...............
data() {
return {
currentTab:0,
}
},
selectOperation()
{
this.currentTab=1;
},

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.