Get your own Vue server Result Size: 625 x 565
App.vue
FoodItem.vue
main.js
 
<template>
  <h1>The 'errorCaptured' Lifecycle Hook</h1>
  <p>Whenever there is an error in a child component, the errorCaptured() function is called on the parent.</p>
  <p>Open the browser console to see the captured error details.</p>
  <p>'return false;' stops the error from propagating.</p>
  <div>
    <comp-one></comp-one>
  </div>
</template>

<script>
export default {
  errorCaptured(error,compInst,errorSrcType) {
    console.log("error: ", error);
    console.log("compInst: ", compInst);
    console.log("errorSrcType: ", errorSrcType);
    return false;
  }
}
</script>

<style>
#app > div {
  border: dashed black 1px;
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  background-color: lightgreen;
}
</style>                  
http://localhost:5173/