<!-- fichier index.html -->

<!DOCTYPE html>
<html lang="fr">
  <head>
      <title>index.html</title>
    </head>
  <body>
    <div id="app">
      <base-input :label="label" @focus.native="message = 'Remplir le formulaire'"></base-input> {{ message }}
    </div>
    <!-- chargement de la librairie Vue.js -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>
      Vue.component('base-input', {
        props: ['label'],
        template: `
          <label>
            {{ label }}
            <input type="checkbox" v-on="$listeners"/>
          </label>
        `
      });

      let vm = new Vue({
        el: "#app",
        data: {
          message: "",
          label: "cochez"
        }
      });
    </script>
    
  </body>
</html>