Taro - 报错:regeneratorRuntime is not defined

前言

    在Taro中使用async中,报错如下
Taro - 报错:regeneratorRuntime is not defined_第1张图片

解决方法

yarn add @tarojs/async-await

    在app.tsx中添加

if (process.env.TARO_ENV !== 'alipay') {
  require('@tarojs/async-await')
}

你可能感兴趣的:(Taro)