我建立一个动画背景GSAP的TweenLite的。而我目前正在执行它的角度成分。但它总是抛出一个错误“无法找到名为'中国保监会包含在TweenLite的。如何解决这个问题?
我已经尝试过GSAP的其他平台,但它总是抛出同样的错误。
/app.component.同时
import { Component } from '@angular/core';
import TweenLite from "gsap/TweenLite";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
ngOnInit() {
initAnimation();
// animation
function initAnimation() {
animate();
for(let i in points) {
shiftPoint(points[i]);
}
}
function shiftPoint(p) {
TweenLite.to(p, 1+1*Math.random(), {x:p.originX-50+Math.random()*100,
y: p.originY-50+Math.random()*100, ease:Circ.easeInOut,
onComplete: function() {
shiftPoint(p);
}});
}
}
}
请参阅什么产量预计该链接以供参考。
https://hencework.com/theme/pogody/constellation/index.html(在右侧部分中的点线及动画)
我有点理解了它。
我已经在网上进行搜索,发现我导入GSAP错误。
这里是链接:https://greensock.com/forums/topic/13445-using-gsap-with-angular2/
不知为何,你需要点在* .TS组件进口区域的模块(不需要使用进口)
它仍然指向保监会无法找到,但输出抛出预期的结果。
奇怪的...