title: Vue: Waiting for props before mounted is run
body: <p>I have component, ShopCart.vue (code below), that is receiving props from the parent.  One of those props is <code>cartItems</code>.  I am running a function on the cartItems in <code>mounted()</code> but to make sure the props were ready, I put them in <code>Vue.nextTick</code>, which I saw as a solution here on StackOverflow.  That seemed to resolve the issue but I noticed it wasn't reliable and there were instances where the cartItems would be empty when the function was ready.  To test this, I put them in a setTimeout for 3 seconds and then the cartItems had 20 passed items, so I know it's working..it's just running too quickly.  How can I resolve this to ensure the props are ready in this component?</p>
  
  <p><em>Part of the ShopCart.vue</em></p>
  
  <p><code>export default {</code></p>
  
  <pre><code>data() {
      return {
          dataLoaded: false,
          modalType: null,
          orderNotes: null, 
          test: null,
          expireTimes: {
  
          }
      }
  },
  props: {
          cartItems:  {type: Array},
          cart:       {type: Object},
          customer:   {type: Object}
      },
  mounted() {
      let vm = this;      
  
      Vue.nextTick(() =&gt; {
          vm.cartItems.forEach((item, index) =&gt; {
              Vue.set(vm.expireTimes, item.item_id, "")
              this.checkItemExpiry(item.expire_at, item.item_id)
  
          });
      });
  
  }
  </code></pre>