Vue.js 在vue中使用异步\等待?

Vue.js 在vue中使用异步\等待?,vue.js,webpack,async-await,babeljs,Vue.js,Webpack,Async Await,Babeljs,我想在Vue中使用async\Wait。 有order-list.vue,简而言之,这是: getOrder:function(){ 返回新承诺(功能(解决、拒绝){ 设置超时(()=>{ log('helloworld'); 解析(真) }, 2000) }); }, 示例:async()=>{ console.log('start'); 为了(让我加入这个。命令){ 等待这个。getOrder()。然后( console.log('loaded'+i) ) } console.log('f

我想在Vue中使用async\Wait。 有order-list.vue,简而言之,这是:

getOrder:function(){
返回新承诺(功能(解决、拒绝){
设置超时(()=>{
log('helloworld');
解析(真)
}, 2000)
});
},
示例:async()=>{
console.log('start');
为了(让我加入这个。命令){
等待这个。getOrder()。然后(
console.log('loaded'+i)
)
}
console.log('finish');

}
尝试使用此Babel配置:
module.exports={“预设”:[[“@vue/app”,{“useBuiltIns”:“entry”}]}
它可以在vue CLI 3中正常工作。尝试使用此Babel配置:
module.exports={“预设”:[“@vue/app”,{“useBuiltIns”:“entry”}]]}
它与Vue CLI 3一起开箱即用。