Jianru-Lin / lambda-view

A New Tool for Reading JavaScript Code since 2017

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ES6 ... feature support required

KingMario opened this issue · comments

  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 这看起来不是一个合法的代码片段。能运行?

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

@KingMario 好的,我研究下