我想在Ionic3中实现这个插件。据我所知,npm包没有来自club的插件,也没有@types/gsap。我添加了DrawSVGPlugin。js进入node\u模块/gsap,然后重新创建了一个android平台。
在里面ts文件作为我尝试的导入:
import { DrawSVGPlugin } from "gsap/DrawSVGPlugin";
作为调用插件:
TweenLite.to("#svg_1", 1, {drawSVG:"40% 60%", ease:Power1.easeInOut});
我的svg html源:
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 100 100" preserveAspectRatio="none">
<line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_1" y2="45.78805" x2="87.36405" y1="45.24458" x1="8.28813" stroke-width="12.5" stroke="#000" fill="none"/>
</svg>
有人能告诉我我做错了什么吗?还是有不同的方法?