title: Reload component after POST api VUEJS
body: <p>I have problems to reload components in my app VueJS with NUXTJS.
  I have a page in my app and this page called a component “CustomerCard”.</p>
  <p>I use a fetch to talk to my API and have all my customers. It works very well when I arrive in this page.</p>
  <p>I have a modal with a form and when I add a customer via this modal, the customer is recorded in my database. It works but when the modal closing, I don’t know how to re-render the component… (when I click on my navigation it does not work neither)</p>
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
    &lt;div &gt;
      &lt;a-button type=&quot;primary&quot; @click=&quot;showModal&quot;&gt;
        Add a customer
      &lt;/a-button&gt;
      &lt;a-modal
        title=&quot;Name :&quot;
        :visible=&quot;visible&quot;
        :confirm-loading=&quot;confirmLoading&quot;
        @ok=&quot;handleOk&quot;
        @cancel=&quot;handleCancel&quot;
      &gt;
        &lt;div&gt;
          &lt;a-form :label-col=&quot;{ span: 5 }&quot; :wrapper-col=&quot;{ span: 12 }&quot; &gt;
            &lt;a-form-item &gt;
              &lt;a-input
                v-decorator=&quot;['note', { rules: [{ required: true, message: 'Entrer le nom du client!' }] }]&quot;
                v-model=&quot;newcustomer&quot;
              /&gt;
            &lt;/a-form-item&gt;
          &lt;/a-form&gt;
        &lt;/div&gt;
  
      &lt;/a-modal&gt;
      &lt;CustomerCard v-bind:array-customers=&quot;customer&quot; &gt;&lt;/CustomerCard&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  <p>the javascript :</p>
  <pre class="lang-js prettyprint-override"><code>
  export default {
    components: {CustomerCard},
    layout: &quot;dashboard&quot;,
    name: &quot;DashboardHome&quot;,
    middleware: 'authenticated', //display page only for connected users
  
    data() {
      return {
        customer: [],
        visible: false,
        confirmLoading: false,
        newcustomer:&quot;&quot;,
      }
    },
  
    created() {
      this.getAllCustomers();
    },
  
  
    methods: {
  
      showModal() {
        this.visible = true;
      },
  
      //when click on OK button, record the customer in api
      handleOk(e) {
        this.confirmLoading = true;
        axios
        .post('http://127.0.0.1:8000/api/customers', {
          name : this.newcustomer
        });
        setTimeout(() =&gt; {
          this.visible = false;
          this.confirmLoading = false;
        }, 1000);
      },
  
      //click cancel button
      handleCancel(e) {
        console.log('Clicked cancel button');
        this.visible = false;
      },
  
      //get all customers in api
      getAllCustomers() {
        axios.get('http://127.0.0.1:8000/api/customers')
          .then((res)=&gt;{
            console.log(res.data['hydra:member'])
            this.customer = res.data['hydra:member']
            //this.totalStudies()
          }).catch(err=&gt;console.log(err))
      }
  
  
  </code></pre>
  <p>So how can I reload the component CustomerCard when I post a customer ?
  Thanks a lot for helping</p>