Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vaadin JavaScript client-side connector
window.com_xetics_mes_vue_VueComponent = function () {
var container = this.getElement();
var connector = this;
var mapState = Vuex.mapState;
var model = {
message: ""
}
const store = new Vuex.Store({
state: model,
actions: {
callVaadin(state, payload) {
connector.onSyncColorPicker(payload)
},
onSyncColor(state, payload) {
connector.onSyncColorPicker(payload);
}
},
mutations: {
setMessage ( state, message) {
state.message = message;
}
}
})
console.debug("store: ", store);
var vm = window.ColorPicker.createColorPicker('#app', model, store);
console.debug("vue: ", vm);
this.onStateChange = function () {
connector.onSyncColorPicker(this.getState().message)
console.debug("new color: " + this.getState().message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment