mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { EventData } from "tns-core-modules/ui/page";
|
|
import { Button } from "tns-core-modules/ui/button";
|
|
|
|
export function onNavigate(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate("some-page/some-page");
|
|
}
|
|
|
|
export function onNavigateNone(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate({
|
|
moduleName: "some-page/some-page",
|
|
animated: false
|
|
});
|
|
}
|
|
|
|
export function onNavigateSlide(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate({
|
|
moduleName: "some-page/some-page",
|
|
animated: true,
|
|
transition: {
|
|
name: "slide",
|
|
duration: 300,
|
|
curve: "easeIn"
|
|
}
|
|
});
|
|
}
|
|
|
|
export function onNavigateFlip(args: EventData) {
|
|
const button = <Button>args.object;
|
|
button.page.frame.navigate({
|
|
moduleName: "some-page/some-page",
|
|
animated: true,
|
|
transition: {
|
|
name: "flip",
|
|
duration: 300,
|
|
curve: "easeIn"
|
|
}
|
|
});
|
|
}
|
|
|
|
export function onBackButtonTap(args: EventData): void {
|
|
const button = <Button>args.object;
|
|
button.page.frame.goBack();
|
|
}
|