Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/packages/lottie/index.taro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Partial<LottieProps>> = implementation as any
export default Lottie
Loading