[Vuejs]-Child component not updating when prop (boolean) is changed by parent component

0👍

I actually found the solution myself jut now:

In the child component I was trying to access the props’ data through the data object. But I just accessed to props’ data directly like so:

<div   
  :class="{ 'modal--show': modal }"> 
...

export default {   
  props: {
    modal: Boolean 
  } 
}

0👍

Correct.

Other options for syncing if this parent/child relationship is more complex, or you needed to pass back upward to the parent:

Leave a comment