[Vuejs]-Vue – Show a div when a response if loaded

1👍

You should change the state after a successful get request

<div v-if="correct" class="alert alert-success" role="alert">
      <strong>Correcto</strong>. Datos actualizados de forma satisfactoria.
</div> 

methods: {
  guardar: function () {
     axios
         .get('ENDPOINT')
         .then(response => {
            // here update the correct state
            this.correct = true
          })
          .catch(function (error) {
             console.log(error)
             this.correct = false
          })
     }
 }

Leave a comment