async await $api vue

async getDataNew () {
      const res = await this.$api('apiPath')
      if (res && res.status === 20) {
        // do something
      }
    }
posted @ 2020-04-20 11:19  彭成刚  阅读(450)  评论(0编辑  收藏  举报