首页 > 其他分享 >Vue中的async和await【reggie_take_out】

Vue中的async和await【reggie_take_out】

时间:2023-01-14 09:22:34浏览次数:67  
标签:Vue res await take async reggie out

https://blog.csdn.net/G_Z_X/article/details/123535642
https://gitee.com/yub4by/my-reggie-take-out
resources/backend/page/food/list.html

methods: {
          async init () {
            const params = {
              page: this.page,
              pageSize: this.pageSize,
              name: this.input ? this.input : undefined
            }
            await getDishPage(params).then(res => {
              if (String(res.code) === '1') {
                this.tableData = res.data.records || []
                this.counts = res.data.total
              }
            }).catch(err => {
              this.$message.error('请求出错了:' + err)
            })
          },
}

标签:Vue,res,await,take,async,reggie,out
From: https://www.cnblogs.com/yppah/p/17051264.html

相关文章