/** *@author zhangwenshuai *@date 2019-07-01 14:42 * */ import React, { Component } from 'react'; import lottie from 'lottie-web'; import classnames from 'classnames'; import animationData from './loading.json'; import s from './index.less'; export default class BISpin extends Component { componentDidMount() { lottie.loadAnimation({ container: this.loading, // the dom element that will contain the animation renderer: 'svg', loop: true, autoplay: true, animationData, // path: './loading.json', // the path to the animation json }); } render() { const { spinning = true, size, style, className } = this.props; return ( <>
{ this.loading = dom; }} />
{this.props.children}
); } }