當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Frame.navigate方法代碼示例

本文整理匯總了TypeScript中tns-core-modules/ui/frame.Frame.navigate方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Frame.navigate方法的具體用法?TypeScript Frame.navigate怎麽用?TypeScript Frame.navigate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tns-core-modules/ui/frame.Frame的用法示例。


在下文中一共展示了Frame.navigate方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test_frame_retrieval_API_when_navigating

export function test_frame_retrieval_API_when_navigating() {
    const rootView = getRootView();

    const initialFrame = new Frame();
    initialFrame.id = "initialFrame";
    initialFrame.navigate(() => new Page());

    const initialTopmost = topmost();
    const initialFrameById = getFrameById("initialFrame");

    TKUnit.assertEqual(initialTopmost, initialFrame);
    TKUnit.assertEqual(initialFrameById, initialFrame);

    const newFrame = new Frame();
    newFrame.id = "newFrame";
    newFrame.navigate(() => new Page());

    const newTopmost = topmost();
    const newFrameById = getFrameById("newFrame");

    TKUnit.assertEqual(newTopmost, newFrame);
    TKUnit.assertEqual(newFrameById, newFrame);

    initialFrame.navigate(() => new Page());

    const previousTopmost = topmost();
    const previousFrameById = getFrameById("initialFrame");

    TKUnit.assertEqual(previousTopmost, initialFrame);
    TKUnit.assertEqual(previousFrameById, initialFrame);

    // clean up the frame stack
    initialFrame._removeFromFrameStack();
    newFrame._removeFromFrameStack();
}
開發者ID:qbert,項目名稱:NativeScript,代碼行數:35,代碼來源:frame-tests-common.ts

示例2: createFrame

function createFrame(i: number, page: Page) {
    const frame = new Frame();
    frame.navigate(() => page);
    frame.id = `Tab${i} Frame${i}`;

    return frame;
}
開發者ID:qbert,項目名稱:NativeScript,代碼行數:7,代碼來源:tab-view-root-tests.ts

示例3: topmost

exports.secondaryActionTap = args => {
    googleAnalytics.logEvent({
      category: "Basic Actions",
      action: "Click",
      label: "Secondary Button"
    });

    const topmostFrame: Frame = topmost();
    topmostFrame.navigate("secondary-page");
};
開發者ID:EddyVerbruggen,項目名稱:nativescript-googleanalytics,代碼行數:10,代碼來源:main-page.ts

示例4: tearDownModule

export function tearDownModule() {
    const page = new Page();
    const frame = new Frame();
    frame.navigate(() => page);

    const entry: NavigationEntry = {
        create: () => frame
    };

    waitUntilNavigatedToMaxTimeout([page], () => _resetRootView(entry));
}
開發者ID:qbert,項目名稱:NativeScript,代碼行數:11,代碼來源:tab-view-root-tests.ts

示例5: onModalFrame

export function onModalFrame(args: EventData) {
    const view = args.object as View;

    const frame = new Frame();
    frame.navigate("modal/modal-page");

    view.showModal(frame,
        "context",
        () => console.log("home-page modal frame closed"),
        false);
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:11,代碼來源:second-page.ts

示例6: createTestFrameRootEntry

function createTestFrameRootEntry() {
    const page = new Page();
    const frameRoot = new Frame();
    frameRoot.navigate(() => page);

    const entry: NavigationEntry = {
        create: () => frameRoot
    };

    return {
        entry: entry,
        root: frameRoot,
        page: page
    };
}
開發者ID:NathanaelA,項目名稱:NativeScript,代碼行數:15,代碼來源:reset-root-view-tests.ts

示例7: function

 btnActivity.on(button.Button.tapEvent, function () {
     var newFrame = new frame.Frame();
     var newPage = "tests/pages/navigation/pageA-new-activity";
     newFrame.navigate(newPage);
 });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:5,代碼來源:pageB.ts


注:本文中的tns-core-modules/ui/frame.Frame.navigate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。