Skip to content

Instantly share code, notes, and snippets.

@fezu54
fezu54 / VueState.java
Created Dec 24, 2019
JavaScriptComponentState providing a message state
View VueState.java
public class VueState extends JavaScriptComponentState {
public String message = "";
}
@fezu54
fezu54 / VueComponent.java
Created Dec 24, 2019
Vaadin JavaScript server-side component
View VueComponent.java
@StyleSheet({"colorPicker.css"})
@JavaScript({"vue.js","es6-promise.auto.js", "vuex.js", "bundle.js", "vaadin-injector.js"})
public class VueComponent extends AbstractJavaScriptComponent {
private Consumer<Color> onColorChangedConsumer;
public VueComponent() {
setId("app");
addFunction("onSyncColorPicker", arguments -> {
Notification.show("Message from VUE: " + arguments.get(0).asString());
@fezu54
fezu54 / vaadin-injector.js
Created Dec 24, 2019
Vaadin JavaScript client-side connector
View vaadin-injector.js
window.com_xetics_mes_vue_VueComponent = function () {
var container = this.getElement();
var connector = this;
var mapState = Vuex.mapState;
var model = {
message: ""
}