2017-03-02 52 views
1

x.vue文件在沒有Object.assign的情況下使用mapActions錯誤?

methods: { 
    ...mapActions([ 
     'fetchTopicVideo', 
    ]), 
} 

這將是拋出錯誤,錯誤信息是:

ERROR in ./~/buble-loader!./~/vue-loader/lib/selector.js? 

type=script&index=0!./src/components/CardList.vue 
Module build failed: 
43 :  // }, (res) => { 
44 :  // console.log('query error') 
45 :  // }) 
46 : }, 
47 : methods: { 
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
Object spread operator requires specified objectAssign option with 'Object.assign' or polyfill helper. (47:11) 
@ ./src/components/CardList.vue 7:2-105 
@ ./~/buble-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./src/views/ClientTopicShare.vue 
@ ./src/views/ClientTopicShare.vue 
@ ./src/router/index.js 
@ ./src/app.js 
@ ./src/client-entry.js 
@ multi webpack-hot-middleware/client ./src/client-entry.js 

但下面的代碼不會拋出錯誤:

methods: Object.assign({}, 
    mapActions([ 
    'fetchTopicVideo' 
    ]) 
) 

.babelrc文件:

{ 
    "presets": ["es2015", "stage-2"], 
    "plugins": ["transform-runtime"], 
    "comments": false 
} 

也許babel失敗導致這一點。

+0

你說得對有關問題正在與巴別塔,你可以分享你的package.json以及? –

+0

通過https://github.com/vuejs/vue-hackernews-2.0/issues/87 – Youngbye

回答

相關問題