mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
32 lines
500 B
TypeScript
32 lines
500 B
TypeScript
import {App, Page, Animation} from 'ionic/ionic';
|
|
|
|
|
|
@Page({
|
|
templateUrl: 'main.html'
|
|
})
|
|
class E2EPage {
|
|
|
|
constructor() {
|
|
this.duration = '1000';
|
|
this.easing = 'ease-in-out';
|
|
}
|
|
|
|
playGreen() {
|
|
let a = new Animation('.green');
|
|
a.fromTo('translateX', '0px', '200px');
|
|
a.duration(parseInt(this.duration));
|
|
a.easing(this.easing);
|
|
a.play();
|
|
}
|
|
}
|
|
|
|
|
|
@App({
|
|
template: '<ion-nav [root]="root"></ion-nav>'
|
|
})
|
|
class E2EApp {
|
|
constructor() {
|
|
this.root = E2EPage;
|
|
}
|
|
}
|