zhuzichu520 / FluentUI

FluentUI for QML
MIT License
3.48k stars 456 forks source link

如何在页面之间导航时防止视图重置?2 #470

Open RyanQurisG2 opened 6 months ago

RyanQurisG2 commented 6 months ago

English: I have two pages, and I'm using FluNavigationView. Both pages are FluPage with launchMode: FluWindowType.SingleTask. The FluNavigationView has the property pageMode: FluNavigationViewType.Stack.

The second page gets instantiated every time I perform navigation.push(), whereas the first page is correctly reused from memory.

In other words, I lose the information of my second page, while this does not happen with the first page. Thank you very much for your help.

Chinese (Simplified): 我有两个页面,并且我正在使用 FluNavigationView。这两个页面都是设置了 launchMode: FluWindowType.SingleTask 的 FluPage。FluNavigationView 设置了属性 pageMode: FluNavigationViewType.Stack。

每次我执行 navigation.push() 时,第二个页面都会重新实例化,而第一个页面则能正确地从内存中复用。

换句话说,我会丢失第二个页面的信息,而第一个页面则不会出现这种情况。非常感谢你的帮助。

zhuzichu520 commented 6 months ago

launchMode 请用FluPageType.SingleInstance