Question from the Vue.js test

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

Archived

What this component will generate in the DOM ?

<template>
  <div>
    <h1 v-if="isTitleShown">
      Rendering DOM Vuejs
    </h1>
    <button>
      <template v-if="isButtonActivated">
        Activé
      </template>
      <template v-else>
        Désactivé
      </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: JulesStatus: Archived(New question!)Question passed 26 times
0
Community EvaluationsNo one has reviewed this question yet, be the first!