Car*_*tes 2 svg json reactjs lottie
我已经从lottie-react-web包创建了一个组件。
import React from 'react';
import Lottie from 'lottie-react-web'
import animation from '../../src/animations/anim.json'
const LottieAnim = () => (
<Lottie
options = {{
animationData: animation,
loop: false,
autoplay: true,
}}
width = "60px"
height = "60px"
/>
)
export default LottieAnim
Run Code Online (Sandbox Code Playgroud)
这有效并成功构建。当 DOM 加载时,它会生成具有定义属性的包装器 div。但是,div 中的 svg 没有定义的 viewbox 参数,以及未定义的宽度和高度,以及 svg 中的包含向量。
归档时间: |
|
查看次数: |
2305 次 |
最近记录: |