Lottie component, used to integrate and display Lottie animations in mini programs. Lottie animation is an animation library developed by Airbnb, which uses JSON format animation data and can run on various platforms such as web pages and mobile applications.
Example
you can refer to the following example to configure the webpack config file.
- pika.config/webpack.config.js
Code
js
Code
bxml
Code
bxss
Code
Events
- sdk ≥
4.38.0
| Event | Description |
|---|---|
onComplete | trigger on Lottie animation completed without loop: false. |
onLoopComplete | trigger on Lottie animation completed with loop: true. |
onSegmentStart | trigger on Lottie animation start a segment. |
onConfigReady | trigger on Lottie animation config ready. |
onDataReady | trigger on Lottie animation data ready. |
onDataFailed | trigger on Lottie animation data failed. |
onLoadedImages | trigger on Lottie animation loaded images. |
onDOMLoaded | trigger on Lottie animation DOM loaded. |
onDestroy | trigger on Lottie animation destruction. |
- remark - sdk ≥ 4.38.0 pika ≥ 0.3.57 @binance/bmp-api ≥ 1.0.153
Props
| Name | Type | Description | Default |
|---|---|---|---|
lottie-id required | string | ||
renderer | RendererType | "svg" | |
loop | boolean | true | |
autoplay | boolean | true | |
path required | string | ||
renderer-settings | AnimationConfigWithData['rendererSettings'] | ||
initial-segment | AnimationSegment | Â |
Events
| Name | Description |
|---|---|
bindcomplete | Arguments{ _currentTarget: this.$el, _type: 'complete', _detail: e, }: object |
bindloopcomplete | Arguments{ _type: 'loopcomplete', _currentTarget: this.$el, _detail: e, }: object |
bindsegmentstart | Arguments{ _currentTarget: this.$el, _type: 'segmentstart', _detail: { animationName: this.lottieId, }, }: object |
bindconfigready | Arguments{ _currentTarget: this.$el, _type: 'configready', _detail: { animationName: this.lottieId, }, }: object |
binddataready | Arguments{ _currentTarget: this.$el, _type: 'dataready', _detail: { animationName: this.lottieId, }, }: object |
binddatafailed | Arguments{ _currentTarget: this.$el, _type: 'datafailed', _detail: { animationName: this.lottieId, }, }: object |
bindloadedimages | Arguments{ _currentTarget: this.$el, _type: 'loadedimages', _detail: { animationName: this.lottieId, }, }: object |
binddomloaded | Arguments{ _currentTarget: this.$el, _type: 'DOMLoaded', _detail: { animationName: this.lottieId, }, }: object |
binddestroy | Arguments{ _currentTarget: this.$el, _type: 'destroy', _detail: { animationName: this.lottieId, }, }: object |
Was this page helpful?
Last modified on