Table des matières

TD n°4

SpringBoot - VueJS

 

Notions abordées

  • Back-end :
    1. Service Rest
    2. Génération SPA
  1. Front-end :
    • SPA vueJS
    • Vuetify
    • Composants

Application messagerie (suite)

Les composants permettent d'associer un comportement à un ensemble d'éléments visuels paramétrables et réutilisables.

Création

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