Question from the Vue.js test

Write a Vue component that renders a title, a button and a notice.

Medium

What this component will generate in the DOM ?

<template>
  <div>
    <h1 v-if="isTitleShown">
      Rendering DOM Vuejs
    </h1>
    <button>
      <template v-if="isButtonActivated">
        Activate
      </template>
      <template v-else>
        Desactive
      </template>
    </button>
    <p v-show="isNoticeDisplayed">
      User doesn't see directly the DOM
    </p>
  </div>
</template>
<script>
import { defineComponent, ref } from 'vue';

export default defineComponent({
  setup() {
    return {
      isTitleShown: ref(true),
      isButtonActivated: ref(false),
      isNoticeDisplayed: ref(false)
    };
  }
});
</script>
Author: MathisStatus: Published(Update)Question passed 14 times
Edit
0
Community Evaluations
developer avatar
Vincent Cotro
22/11/2023
Merci Mathis pour la correction !