M
M
Max99992020-07-04 14:47:56
Vue.js
Max9999, 2020-07-04 14:47:56

Warning in vue, which is not a problem?

All good afternoon.
In the parent component, I call the component:

<div   v-else v-for="(post, index) in visibilityData" :key="post.index" >
    <DataItem 
    :post="post"
    :index="index" 
    :quantity="visibilityData.length"
   vizad
   vizadtex
   btnnorm
    />
  </div>


The DataItem has props that I change in it, for example, this.btnnorm = true. Vue complains about this:

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. Prop being mutated: "btnnorm"


In principle, it’s clear what it’s swearing at .. But this behavior is what I need ... When changing the visibilityData in the parent component, it was redrawn with default values. I read it. they write that you need to write props to data and change them there. Asked through them. but then

Property or method "vizcompare" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

and there and there I set the initial values ​​..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question