From b5dd80e722e2ab1d762d0b01342b43be9758e240 Mon Sep 17 00:00:00 2001 From: oasis Date: Mon, 17 Feb 2025 16:58:09 +0800 Subject: [PATCH] fix: throw error should not block the export of component --- src/packages/lottie/index.taro.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packages/lottie/index.taro.ts b/src/packages/lottie/index.taro.ts index 5cd7859b3e..6c070ddf0d 100644 --- a/src/packages/lottie/index.taro.ts +++ b/src/packages/lottie/index.taro.ts @@ -5,11 +5,16 @@ import { LottieProps } from './types' let implementation if (process.env.TARO_ENV === 'h5') { + // @ts-ignore implementation = LottieWeb } else if (process.env.TARO_ENV === 'weapp') { + // @ts-ignore implementation = LottieMp } else { - throw new Error(`不支持的 TARO_ENV: ${process.env.TARO_ENV}`) + // throw new Error(`不支持的 TARO_ENV: ${process.env.TARO_ENV}`) + implementation = (props: any) => { + return props.children + } } const Lottie: ComponentType> = implementation as any export default Lottie