[Vuejs]-Getting the value of a parent computed function, from a child component in VueJS

1👍

Parent


computed: {
    isSaving() {
      // add `this.`
      return (
          this.status && this.status != "done"
        )
      );
    }
}

<SaveButton v-bind:saveState="isSaving"/>

Child

<script>    
export default {
  name: "saveButton",
  props: ['saveState']
}
</script>
<template>
  <div class="settings--button-wrapper">
    <!-- use `saveState` -->
    <button>
      {{ saveState ? 'Saving..' : 'Save' }}
    </button>
  </div>
</template>

-1👍

You should use saveState instead of isSaving.

Leave a comment