\n```","suggestedAnswer":[{"@type":"Answer","text":"```html\n
\n

Rendering DOM Vuejs

\n \n

User doesn't see directly the DOM

\n
\n```"},{"@type":"Answer","text":"```html\n
\n

Rendering DOM Vuejs

\n \n
\n```"},{"@type":"Answer","text":"```html\n
\n

Rendering DOM Vuejs

\n \n

User doesn't see directly the DOM

\n
\n```"},{"@type":"Answer","text":"```html\n
\n

Rendering DOM Vuejs

\n \n
\n```"}],"acceptedAnswer":[{"@type":"Answer","text":"```html\n
\n

Rendering DOM Vuejs

\n \n

User doesn't see directly the DOM

\n
\n```"}]}}

Question du test Vue.js

Écrire un composant Vue qui affiche un titre, un bouton et une notice.

Archivée

Que va générer ce composant dans le 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>
Auteur: JulesStatut : Archivée(Nouvelle question !)Question passée 26 fois
0
Évaluations de la communautéPersonne n'a encore évalué cette question, soyez le premier !