What is the difference between a () {} and a: () = > {}?

I thought there was little difference between the two writing methods, but today I found out that this is not the case: this is not the case in the
project. Bug has been looking for it for a long time.

SET_ACTIVE_INDEX (state, payload) {
  state.activeIndex = payload.index
}

change it to the figure below

which student will be grateful to tell me what a () {} equates to?

Mar.18,2021

the difference is that one is an ordinary function declaration (the abbreviation of an object method is a normal function), and the other is an arrow function. The difference between this .

  

did not report an error, otherwise it would not have been found for so long, there is an es6 environment. Brother, you didn't answer my question. According to mdn, what's the difference between a:func () {} and a: () = > {}?

Menu