Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearHistory is removing the Frame component when the Frame is in a component template #472

Closed
Julien-R44 opened this issue Apr 6, 2019 · 8 comments

Comments

@Julien-R44
Copy link

Version

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

@rigor789
Copy link
Member

rigor789 commented Apr 6, 2019

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.

@Julien-R44
Copy link
Author

Yes i found this workaround too, but i still wanted to report this bug.
Do you have begun work on supporting Vue Router ? There are some issues with manual routing.
Thanks you !

@rigor789
Copy link
Member

rigor789 commented Apr 6, 2019

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.

@rigor789 rigor789 added the bug label May 31, 2019
@TemaSM
Copy link

TemaSM commented Aug 8, 2019

@rigor789 how about transitions and something like <router-view> while changing routes?
I'm trying manual routing approach from nativescript-vue docs, but cannot implement this behavior:
Main app wrapper should stay in place with its styles (background image), and route change triggers only changing container's content (like <router-view>).
May you please give some tips on how to implement it with current nativescript-vue routing system?

@rigor789
Copy link
Member

rigor789 commented Aug 9, 2019

@TemaSM You can set the transition between pages, however I don't think any of the default/existing ones do what you're looking for. You can build a custom transition (I've never done it myself) based on this doc https://docs.nativescript.org/ui/ns-ui-widgets/frame#navigation-transitions (scroll to the "Custom Transitions" section).

@TemaSM
Copy link

TemaSM commented Aug 9, 2019

@rigor789 thanks for tips and link. Already tried by this article, which mostly helped me, but app's screens/pages still slides as whole Frame (with background image) not as containers in Frame itself.

@rigor789
Copy link
Member

@TemaSM you can do something like this: https://play.nativescript.org/?template=play-vue&id=Ltgbh6

Set the page background to transparent, and navigate the frame. The background color comes from a wrapping element.

@nativescript-vue-bot
Copy link
Collaborator

We are locking this issue because it has been closed for more than 14 days.

If the issue comes up again please open a new issue with additional details.

@nativescript-vue nativescript-vue locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants