async await $api vue

async getDataNew () {
      const res = await this.$api('apiPath')
      if (res && res.status === 20) {
        // do something
      }
    }
原文地址:https://www.cnblogs.com/pengchenggang/p/12736655.html