Permalink
Browse files

Finalized vue.js posting.

  • Loading branch information...
mirkosertic committed Dec 21, 2018
1 parent 0cb7722 commit f703003f2fc2beb5816a566c4ecaf5c70078f80d
Showing with 8 additions and 8 deletions.
  1. +8 −8 content/post/webassembly-and-vuejs.adoc
@@ -86,18 +86,18 @@ public class VueDemo {
void welcomemessage(String aNewMessage);
}
public static void main(String[] args) <2> {
public static void main(String[] args) { // <2>
VueBuilder theBuilder = Vue.builder(); <3>
theBuilder.bindToTemplateSelector("#vuetemplate"); <4>
theBuilder.data().setProperty("welcomemessage", "hello world!");<4>
theBuilder.addEventListener("clicked", new VueEventListener() { <5>
VueBuilder theBuilder = Vue.builder(); // <3>
theBuilder.bindToTemplateSelector("#vuetemplate"); // <4>
theBuilder.data().setProperty("welcomemessage", "hello world!"); // <4>
theBuilder.addEventListener("clicked", new VueEventListener() { // <5>
@Override
public void handle(MyVueInstance instance, ClickEvent event) {
instance.welcomemessage("Timestamp is " + System.currentTimeMillis());
}
});
MyVueInstance instance = theBuilder.build();<6>
MyVueInstance instance = theBuilder.build(); // <6>
}
}
----
@@ -117,10 +117,10 @@ This program also needs a HTML template:
display: none;
}
</style>
<div v-cloak id="vuetemplate"> <1>
<div v-cloak id="vuetemplate"> <!--1-->
<h1>Hello, this is a vue.js instance running with WebAssembly</h1>
<span>Current message : {{welcomemessage}}</span>
<button v-on:click="clicked">Click me to change the message!</button> <2>
<button v-on:click="clicked">Click me to change the message!</button> <!--2-->
</div>
----
<1> HTML element with id "vuetemplate" is referenced in the Java code

0 comments on commit f703003

Please sign in to comment.