clearHistory is removing the Frame component when the Frame is in a component template
See original GitHub issueVersion
2.2.0
Reproduction link
https://play.nativescript.org/?template=play-vue&id=eA0tz9
Platform and OS info
Nativescript-Vue 2.2.0 / Android 7.0
Steps to reproduce
My default Frame is in my App.vue component :
<template>
<Frame>
<Page>
<StackLayout>
<Label>App.vue</Label>
<Button text="Button" @tap="onButtonTap" />
</StackLayout>
</Page>
</Frame>
</template>
I’m creating my Vue root instance without inserting Frame like that :
new Vue({
render: h => h(App),
}).$start()
And when i use a $navigateTo with clearHistory set as true, the default Frame from App.vue will be removed and i will not be able to navigate anymore.
I’ve created a reproduction link with Nativescript Playground so you can see what’s is happening
What is expected?
The default frame has not to be deleted
What is actually happening?
The default frame is removed
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
c# - How to clear navigation history in a frame when using the ...
Just wrap the solution with NavigationService.RemoveBackEntry method in the behavior/attached property and apply it to your Frame in xaml.
Read more >Routing breaks when using Frame.goBack(to: BackstackEntry)
For example: Navigate to another page. import { Component, OnInit } from "@angular/core"; import { ActivatedRoute, Router } from ...
Read more >How to Clear Your Browser History - Delete Your Browsing ...
Click that same library tab, select "History" and then "Show all history" down at the bottom.
Read more >Clear browsing data - Computer - Google Chrome Help
You can control your history and other browsing data, like saved form entries. You can delete all of your data or just some...
Read more >How to clear out a frame in the Tkinter? - Tutorialspoint
If we want to clear the frame content or delete all the widgets inside the frame, we can use the destroy() method.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, VueRouter is not supported currently, and will not be for a while. You can use
nativescript-vue-navigator
as a minimalistic router that lets you keep track of the current route and lets you define routes in a central place.Looking at the code, this seems like a bug, however it can easily be worked around, either by defining the frame in main.js in the render function, or extracting the first page into a component, and rendering it that way: https://play.nativescript.org/?template=play-vue&id=eA0tz9&v=3
I have plans to improve Frames in general, and will investigate this further.