B
B
BonBon Slick2017-10-12 16:43:43
Vue.js
BonBon Slick, 2017-10-12 16:43:43

Method declaration difference func() {} vs func: function(e) {}?

The docs don't say anything about the difference https://v1.vuejs.org/guide/events.html
Can you please tell me what's the difference? And which is better to use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-10-12
@BonBonSlick

func() {} is a shortened declaration of methods from es6
if you are using es6, then it is preferable to use it
(it is not clear what DOM events have to do with it, they do not affect this in any way)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question