In the default example project for both server-side Blazor and WebAssembly Blazor projects, the Counter example resets to 0 every time you move between the pages.
(在服务器端Blazor和WebAssembly Blazor项目的默认示例项目中,每次在页面之间移动时,Counter示例都会重置为0。)
However, on the ASP.NET React example project, the Counter does not reset between page switches. (但是,在ASP.NET React示例项目中,计数器不会在页面切换之间重置。)
Is there a way for a component like the Counter to preserve state between page navigation in Blazor (at least for the WebAssembly project that isn't making any server calls)?
(是否有一种方法可以使诸如Counter之类的组件在Blazor中的页面导航之间保留状态(至少对于不进行任何服务器调用的WebAssembly项目)?)
ask by pkr298 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…