java:springmvc:vuejs

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
java:springmvc:vuejs [2018/10/04 02:06] – [Element UI + VueJS integration] jcheronjava:springmvc:vuejs [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1
Ligne 29: Ligne 29:
  text-decoration: none;  text-decoration: none;
 } }
 +</sxh>
 +
 +===== Maven integration =====
 +
 +Créer le dossier local-maven-repo à la base du projet Eclipse.
 +Télécharger la librairie [[https://gitlab.com/jcheron/springboot-vuejs/tags|springboot-vuejs.jar]], et copier là dans ce dossier
 +
 +<sxh xml;title:pom.xml>
 +<dependency>
 +    <groupId>com.sample</groupId>
 +    <artifactId>sample</artifactId>
 +    <version>1.0</version>
 +    <scope>system</scope>
 +    <systemPath>${project.basedir}/local-maven-repo/springboot-vuejs.jar</systemPath>
 +</dependency>
 +</sxh>
 +
 +
 +===== Test =====
 +
 +Créer un contrôleur Spring :
 +
 +<sxh java>
 +@Controller
 +@RequestMapping("/ui/")
 +public class UiTest {
 +
 + @GetMapping("test")
 + public String test(ModelMap model) {
 + VueJS vue=new VueJS("#app");
 + vue.addData("input", "Hello world !");
 + model.put("vueJS", vue.getScript());
 + return "ui/test";
 + }
 +
 +}
 +</sxh>
 +
 +Et la vue associée :
 +
 +<sxh html>
 +{{>/header}}
 +<%input%>
 +<el-input placeholder="Please input" v-model="input"></el-input>
 +{{{vueJS}}}
 +{{>/footer}}
 </sxh> </sxh>
  • java/springmvc/vuejs.1538611599.txt.gz
  • Dernière modification : il y a 6 ans
  • (modification externe)