I\'d like to group some of my Vue.js methods together in a sort of \"submethod\" class, but I only seem to be able to have single level methods.
For example, if I wanted
The closest I've got to doing this, is to declare the parent as a function, and return an object with a set of methods.
Example:
new Vue({
el: '#app',
data: {},
methods: {
buttonHandlers: function() {
var self = this; // so you can access the Vue instance below.
return {
handler1: function() {
dosomething;
self.doSomething();
},
handler2: function() {
dosomething;
},
},
}
}
});
And you can call the methods like this: