Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created August 11, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastianallgeier/459e042534bf3ec870132200835b51fe to your computer and use it in GitHub Desktop.
Save bastianallgeier/459e042534bf3ec870132200835b51fe to your computer and use it in GitHub Desktop.
panel.plugin('something/cool', {
fields: {
demo: {
created: function () {
this.$events.$on('form.change', this.onFormChange);
this.$events.$on('form.save', this.onFormSave);
this.$events.$on('form.reset', this.onFormReset);
},
destroyed: function () {
this.$events.$off('form.change', this.onFormChange);
this.$events.$off('form.save', this.onFormSave);
this.$events.$off('form.reset', this.onFormReset);
},
methods: {
onFormChange: function () {
// ...
},
onFormSave: function() {
// ...
},
onFormReset: function() {
// ...
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment