Reputation: 287
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
Reputation: 287
I have found the answer:
methods:{
doJob: function(){
changeme(content)
},
...mapActions([
'changeme'
])
Upvotes: 3