title: Vue.js - update child component's function
body: <p>I have a child component with a prop, but also there's is a mounted function to init date and hour. How to update this function when data from parent is reloaded?</p>
  
  <p>Parent component:</p>
  
  <pre><code> &lt;template&gt;
        &lt;div&gt;
          &lt;ul&gt;
            &lt;li v-for="item in occurrences"&gt;
              {{ item.title }} {{ item.completed }}&lt;/small&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
          &lt;sourceupd class="source" v-bind:source='source'&gt;&lt;/sourceupd&gt;
        &lt;/div&gt;
      &lt;/template&gt;
  
      &lt;script&gt;
        import axios from 'axios'
        import sourceupd from './SourceAndUpdated'
  
        export default {
  
          name: 'Occurrences',
  
          components: {
            sourceupd
          },
  
          data: function () {
            return {
              occurrences: [],
              source: 'ANPC'
            }
          },
  
          mounted: function () {
            var _self = this
  
            function callAPI () {
              // call api code
            }
  
            callAPI()
  
            setInterval(() =&gt; {
              callAPI()
            }, 1024 * 3)
          }
        }
      &lt;/script&gt;
  </code></pre>
  
  <p>Child Component:</p>
  
  <pre><code>&lt;template lang="html"&gt;
      &lt;small class="source-ref"&gt;Fonte: {{ source }} | Actualização:{{ updated.hour }}:{{ updated.minutes }}&lt;/small&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import moment from 'moment'
  
  export default {
    data: function () {
      return {
        updated: {
          hour: '',
          minutes: ''
        }
      }
    },
  
    props: ['source'],
  
    mounted: function () {
      moment.locale('pt')
  
      this.updated.hour = moment().format('HH')
      this.updated.minutes = moment().format('mm')
      this.updated.seconds = moment().format('ss')
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>When callAPI() is reloaded, I would like to update time as well. I'm newbie with Vue.js (or this kind of framework) and I'm struggling how to handle this kind of dynamic information.</p>
  
  <p>Thanks in advance.</p>