import { mapGetters,mapActions } from 'vuex'
export default {
data (){
let change = 'hot';
return {change}
},
computed:{
...mapGetters({
topic:'getTopics',
show:'getShow_2'
})
},
methods:{
...mapActions([
'sortContent'
])
}
}
The above code reports the following error, how to solve it?
Syntax Error: Unexpected token (38:2)
36 | },
37 | computed:{
> 38 | ...mapGetters({
| ^
39 | topic:'getTopics',
40 | show:'getShow_2'
41 | })
迷茫2017-06-12 09:32:45
It should be that the ES6 compilation tool is not installed. npm install
Try it out
我想大声告诉你2017-06-12 09:32:45
These three points are called Spread operator, which is the syntax of ES6. If your running environment does not support it, an error will occur.
Generally, Babel must be configured correctly for conversion.