Get your own Vue server
App.vue
CompOne.vue
main.js
 
<template>
  <h2>Component</h2>
  <p>Below is a log with every time the 'deactivated' hook runs.</p>
  <ol>
    <li v-for="x in hookLog">{{ x }}</li>
  </ol>
  <p>You can also see when the 'deactivated' hook runs in the console.</p>
</template>
  
<script>
export default {
  data() {
    return {
      hookLog: []
    }
  },
  deactivated() {
    console.log("deactivated")
    this.hookLog.push("deactivated");
  }
}
</script>

<style>
  li {
    background-color: lightcoral;
    width: 5em;
  }
</style>                  
http://localhost:5173/