Get your own Vue server
  <h1>The 'updated' Lifecycle Hook</h1>
  <p>Whenever there is a change in our page, the application is updated and the updated() function is called. In this example we use console.log() in the updated() function that runs when our application is updated.</p>
  <p><strong>Open your browser console to see the result.</strong></p>
  <button @click="this.activeComp = !this.activeComp">Add/Remove Component</button>
    <comp-one v-if="activeComp"></comp-one>

export default {
  data() {
    return {
      activeComp: true
  updated() {
    console.log("The component is updated!");

#app {
  max-width: 450px;
#app > div {
  border: dashed black 1px;
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  width: 80%;
  background-color: lightgreen;
    <p>This is the component</p>
import { createApp } from 'vue'

import App from './App.vue'
import CompOne from './components/CompOne.vue'

const app = createApp(App)
app.component('comp-one', CompOne)