@nutui/nutui-react-taro
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
18 lines (17 loc) • 549 B
JavaScript
import { Lottie as LottieWeb } from "./lottieweb";
import { Lottie as LottieMp } from "./lottiemp";
var implementation;
if (process.env.TARO_ENV === 'h5') {
// @ts-ignore
implementation = LottieWeb;
} else if (process.env.TARO_ENV === 'weapp' || process.env.TARO_ENV === 'jd') {
// @ts-ignore
implementation = LottieMp;
} else {
// throw new Error(`不支持的 TARO_ENV: ${process.env.TARO_ENV}`)
implementation = function(props) {
return props.children;
};
}
var Lottie = implementation;
export default Lottie;