0

当我使用 vuejs2.0 和 vuex2.0 构建我的应用程序时,在组件定义中,我想导入一些由操作定义的方法,并且我想以这种方式声明一些其他本地函数:

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

不幸的是,编译器总是抱怨:

SyntaxError:
4

1 回答 1

3

我找到了答案:

methods:{
  doJob: function(){
    changeme(content)
  },
  ...mapActions([
    'changeme'
  ])
于 2016-08-18T16:20:11.640 回答