I see computed properties and methods in the Vue docs like this:
export default {
computed: {
foo: function() { return 'foo'; }
},
methods: {
bar: function(x) { return 'bar ' + x; }
}
}
However, I've also seen the function
keyword omitted. Is this allowed? Are there any drawbacks?
export default {
computed: {
foo() { return 'foo'; }
},
methods: {
bar(x) { return 'bar ' + x; }
}
}