Plugin to use Vue with jRender.
add in jrender.config.xml
<plugin class="org.vuejs.Core"/>index.html
<html>
<body>
<div id="app">
{{ message }}
<button v-on:click="reverseMessage">Reverse Message</button>
</div>
</body>
</html>IndexController.java
@Page(name = "index", path = "index.html")
public class IndexController extends Window {
private Vue app;
public void init(JRenderContext arg0) {
app = new Vue();
app.el("#app");
app.data("message", "Hello Vue!");
app.registerMethod("reverseMessage");
app.init();
}
public void reverseMessage() {
String message = (String) app.getData("message");
app.data("message", new StringBuilder(message).reverse().toString());
}
}