An error was reported when running the vuex project

run npm dev Times error

sources of topics and their own ideas

error in. / Input.vue

Syntax Error: Unexpected token (36:4)

34 |},
35 | methods: {

36 | .mapMutations ([
)
 |     ^

37 | "changeStateFlag",
38 | "changeComponentName"
39 |],

related codes

/ / Please paste the code text below (do not replace the code with pictures)
methods: {

...mapMutations([
  "changeStateFlag",
  "changeComponentName"
]),

what result do you expect? What is the error message actually seen?

Apr.09,2021

may be that the extension operator is not supported. It is recommended to install a babel plug-in
https://babeljs.io/docs/en/ba.

.
  • Vuejs callback problem?

    in the study of the vuex project, I found someone else s code from github. Can the "callback (_ products) " here be used in this way? I don t understand this way of writing . ** * * var _products = [ {"id": 1, "title": &qu...

Menu