vue项目进行时,script标签中,methods事件中函数使用的async/await;包括vue的生命周期钩子

https://www.cnblogs.com/sylys/p/12073905.html

async created() {
    try {
      this.data = await this.fetchData();
    } catch (error) {
      console.error('Error fetching data:', error);
    }
},

 

posted @ 2024-11-25 10:36  铁打的代码流水的bug  阅读(16)  评论(0)    收藏  举报