学习React中
使用Ant Design Mobile 的的走马灯组件
获取数据进行页面渲染出现轮播图只出现一半的情况
直接上解决方案
在渲染轮播图时,设置数据还未放回时的组件渲染值为nul'
import React from "react";
import {
Carousel } from "antd-mobile";
import axios from "axios";
export default class Index extends React.Component {
state = {
swipers: [],
};
// 获取轮播图
getSwipers = async (