[Vuejs]-Changing/updating the attribute in Vue

0๐Ÿ‘

โœ…

I think a nice solution would be to add a flag variable like

new Vue({
  // ...
  data: {
    condition: false
  }
})

and then update it where it is needed like:

vm.condition = true;

and in UI use this logic:

<modal :name="fruit" :opened="opened" 
    v-bind="{ closed: condition ? onComplete : onClose }">

Leave a comment