将 lottie web player 设置为 React 组件
[!IMPORTANT] 此包(
@lottiefiles/React-lottie-player)已过时,不再维护。 请使用@lottiefiles/dotlottie-React代替。
添加 Player 元素,并将 src 属性设置为指向有效 Lottie JSON 的 URL。
| Prop | 说明 | 类型 | 默认值 |
|---|---|---|---|
lottieRef |
获取 lottie 动画对象 | function |
undefined |
onEvent |
监听事件 | function |
undefined |
onStateChange |
播放状态更改 | function |
undefined |
onBackgroundChange |
监听背景更改 | function |
undefined |
autoplay |
加载时自动播放动画。 | boolean |
false |
background |
背景颜色。 | string |
undefined |
controls |
显示控制 |
暂无开放 Issues,或尚未同步最近议题。