如何将GSAP库导入到Ionic项目中。刚开始使用NPM安装GSAP当我输入通过Ionic项目中的GSAP
import { TweenMax, TimelineMax} from "gsap";
我用的打字稿不起作用。 感谢
如何将GSAP库导入到Ionic项目中。刚开始使用NPM安装GSAP当我输入通过Ionic项目中的GSAP
import { TweenMax, TimelineMax} from "gsap";
我用的打字稿不起作用。 感谢
典型的进口
import {TweenMax, Power2, TimelineLite} from "gsap";
获取不包含内部TweenMax
import Draggable from "gsap/Draggable";
import ScrollToPlugin from "gsap/ScrollToPlugin";
对于部分详细信息
你不需要对它的类型。
assets/javascripts
使用GSAP库包括你的文件在您src/index.html
文件是这样的:我已经在几个项目(所有的打字稿)用它
<script src="assets/javascripts/TweenMax.min.js"></script>
您的权利后进口,声明这样的GSAP对象(在你将要使用他们所有的意见):
/*
Normal imports here..
*/
import { LoginPage } from "../login/login";
declare var TimelineMax: any;
declare var TweenMax: any;
declare var Power1: any;
@Component({
selector: 'page-profile',
templateUrl: 'profile.html',
providers: [Data, Api, DatePipe]
})
export class ProfilePage {
...
使用像正常:
...
ionViewDidLoad(){
TweenMax.from(".logo", .5, {
opacity: 0,
y: -72,
ease: Power1.easeOut
});
}
...
谢谢,这个问题是不工作的分型。 –