Open mtsee opened 3 years ago
function LayerComp() { const [animdata, setAnimdata] = useState(null); useEffect(() => { $.getJSON('https://h5ds-cdn.oss-cn-beijing.aliyuncs.com/other/lottie/data.json').done(res => { setAnimdata(res); }) }, []) return <> {animdata && ( <Lottie options={{ assetsPath: 'https://h5ds-cdn.oss-cn-beijing.aliyuncs.com/other/lottie/images', animationData: animdata, speed: 1, // 速度 autoplay: true, renderer: 'svg', loop: true }} />)} </> }
me too +1