Les composants permettent d'associer un comportement à un ensemble d'éléments visuels paramétrables et réutilisables.
Création en Java (composant créé dans src/main/resources/static/vueJS)
public class ButtonConfirmation {
public static void main(String[]args) throws IOException {
VueComponent compo=new VueComponent("confirm-button");
compo.setProps("title","message","validatecaption","type","size");
compo.addProp("width", 500);
compo.addData("dialog",false);
compo.addMethod("validation", "this.$emit('validation');this.dialog=false;");
compo.setDefaultTemplateFile();
compo.createFile(false);
}
}
<v-dialog v-model="dialog" :width="width">
<template v-slot:activator="{ on }">
<v-btn color="red lighten-2