ES6 ... feature support required
KingMario opened this issue · 3 comments
KingMario commented
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 ...
Jianru-Lin commented
@KingMario 这看起来不是一个合法的代码片段。能运行?
KingMario commented
@Jianru-Lin 这是 ES6 stage-3 的对象展开运算符 https://github.com/sebmarkbage/ecmascript-rest-spread,可以通过 babel 转译
Jianru-Lin commented
@KingMario 好的,我研究下