Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mehah/Vue.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue

Plugin to use Vue with jRender.

Installing

add in jrender.config.xml

<plugin class="org.vuejs.Core"/>

Example

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());
	}
}

About

Component for JRender

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages