01- 轮播图组件问题
//获取轮播图数据
async getSwiper() {
const {data,status} = await getSwiper()
if (status === 200) {
this.setState(
{
swiper: data
}, () => {
// 因为setstate异步问题,需要在请求完数据后,在回调中进行设置来实现响应式
this.setState({ isPlay: true})
}
)
}
}