kidsit
kidsit

Reputation: 287

vuex2.0 component methods option :mix mapActions with local defined methods not work

When i use vuejs2.0 and vuex2.0 to structure my app, in the component defination, i'd like import some methods defined by actions and also i'd like to declare some other local functions in this way:

import { mapActions } from 'vuex'
  export default {
    methods:{
      doJob: function(){
          changeme(content)
      },
      mapActions([
          'changeme'
      ])
    }
}

Unfortunately, compiler always complain :

SyntaxError:

Upvotes: 0

Views: 1038

Answers (1)

kidsit
kidsit

Reputation: 287

I have found the answer:

methods:{
  doJob: function(){
    changeme(content)
  },
  ...mapActions([
    'changeme'
  ])

Upvotes: 3

Related Questions