javascript - ...mapGetters error
習慣沉默
習慣沉默 2017-06-12 09:30:45
0
2
749
     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 |          })
習慣沉默
習慣沉默

reply all(2)
迷茫

It should be that the ES6 compilation tool is not installed. npm installTry it out

我想大声告诉你

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template