Is this:
saveUpdate() {
// Some code
}
The same as:
saveUpdate: function() {
// Some code
}
Is there a best practice (ES6) way to define methods on objects (specifically, Vue.js components)?
More context: I am having trouble in my Vue.js application with the methods triggering properly in productions. The methods I have defined seem to work fine in development - but once compiled for production they do not seem to behave in the same way. I have read in the Vue.js documentation that all methods need to be defined as NEW separate functions, and I am now wondering if the way I am defining the methods; is actually not correct.
broader example:
...,
methods: {
saveUpdate() {
// Some code
}
},
...
should I be doing something like:
...,
methods: {
saveUpdate: () => {
// Some code
}
},
...
What is the modern, best practice or accepted way to do this? Or am I looking in the wrong place and my declarations are just fine the way they are?