Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 ... feature support required #23

Open
KingMario opened this issue Feb 21, 2017 · 3 comments
Open

ES6 ... feature support required #23

KingMario opened this issue Feb 21, 2017 · 3 comments

Comments

@KingMario
Copy link

  computed: {
    cartOpened: {
      get () {
        return this._cartOpened
      },
      set (val) {
        this.setCartOpened(val)
      }
    },
    ...mapState({
      cart: state => state.shop.cart,
      products: state => state.shop.products,
      _cartOpened: state => state.shop.cartOpened
    })
  },

The statement ...mapState({ will cause error

lv main.js
[2017-2-21 11:29:01] INFO processing target: /Users/Mario/Work/Projects/maserati/src/main.js
[2017-2-21 11:29:01] ERROR Line 143: Unexpected token ...

@KingMario KingMario changed the title ES6 ... feature not supported ES6 ... feature support required Feb 21, 2017
@Jianru-Lin
Copy link
Owner

@KingMario 这看起来不是一个合法的代码片段。能运行?

@KingMario
Copy link
Author

@Jianru-Lin 这是 ES6 stage-3 的对象展开运算符 https://github.com/sebmarkbage/ecmascript-rest-spread,可以通过 babel 转译

@Jianru-Lin
Copy link
Owner

@KingMario 好的,我研究下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants