标签:style bsp promise rom ror class 框架 div erro
Nuxt.js框架中asyncData方法只能在pages中的.vue文件页面中使用。
如果要一次发送多个请求可进入如下操作:
async asyncData ({ params, error }) { let [request1Data, request2Data, request3Data] = await Promise.all([ axios.get(‘/api/home/request1‘), axios.get(‘/api/home/requset2‘), axios.get(‘/api/home/request3‘) ]) return { data1: request1Data.data, data2: request2Data.data, data3: request3Data.data } }
标签:style bsp promise rom ror class 框架 div erro
原文地址:https://www.cnblogs.com/donz/p/9792492.html