8000 feat: navigate to new page child of frame · Yellowbox-AU/nativescript-vue@c7e5d71 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7e5d71

Browse files
committed
feat: navigate to new page child of frame
1 parent 1c8b74a commit c7e5d71

File tree

1 file changed

+10
-0
lines changed
  • platform/nativescript/runtime/components

1 file changed

+10
-0
lines changed

platform/nativescript/runtime/components/page.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ export default {
2323
if (frame && !frame.firstPageMounted && !frame.$el.nativeView.currentPage) {
2424
frame.firstPageMounted = true
2525
frame.notifyFirstPageMounted(this)
26+
} else if (frame && frame.firstPageMounted) {
27+
// Navigate the frame to the new page, clearing its history, since the intention of replacing
28+
// the only <Page> child of a frame is that we want that page to be shown instead of the
29+
// current one. Do not animate as this is a replacement not a regular navigation.
30+
frame.navigate({
31+
backstackVisible: this.backstackVisible,
32+
clearHistory: true,
33+
animated: false,
34+
create: () => this.$el.nativeView
35+
})
2636
}
2737

2838
const handler = e => {

0 commit comments

Comments
 (0)
0