problem description
antd-mobile Carousel Walking Lantern Lottery Module dynamically requests that the data obtained by fetch cannot be rotated
the environmental background of the problems and what methods you have tried
see the official demo copied, but his is initialized and written dead can be rotated
official example
related codes
/ / Please paste the code text below (do not replace the code with pictures)
import React from "react";
import {Carousel} from "antd-mobile";
class Zjmd extends React.Component {
constructor (props) {
super(props);
}
render () {
// userInfo props [{phone:"xxx"},{phone:"xxx"},{phone:"xxx"}]
const {className, userInfo} = this.props;
return (
<Carousel className="my-carousel"
vertical
dots={false}
dragging={false}
swiping={false}
autoplay
infinite
speed={200}
autoplayInterval={2000}
resetAutoplay={false}>
{userInfo.map(function (v, i) { // map
return div>{v.phone}</div>
})}
</Carousel>
);
}
}
export default Zjmd;
what result do you expect? What is the error message actually seen?
No error is reported, that is, dynamic data is not rotated. If it is written, it can be rotated. It is hoped that the data requested through fetch can traverse carousel
.