要在asp核心预览版3上禁用服务器端预渲染,您只需注释 @(await Html.RenderComponentAsync< MyApp>()).
To disable server side pre-render on asp core preview 3, you just needed to comment @(await Html.RenderComponentAsync<MyApp>()).
从asp核心预览版4开始,当您注释此行时,该页面将不呈现,并且在主要组件 @page"/" 上,标记< app>保持空白.
Since asp core preview 4, when you comment this line, the page doesn't render and on the main component @page "/", the tag <app> remains blank.
那么,我们如何禁用服务器端预渲染?
So, how can we disable server side pre-render ?
推荐答案最后在github上由cores-system找到了一个解决方案来源: github/aspnet/AspNetCore/issues/9584#issuecomment-485257261
Finally found a solution by cores-system in github Source: github/aspnet/AspNetCore/issues/9584#issuecomment-485257261
app.UseEndpoints(endpoints => { endpoints.MapBlazorHub().AddComponent<App>(selector: "app"); endpoints.MapFallbackToFile("index.html"); // or - endpoints.MapFallbackToPage("/_Host"); });希望这行得通...
更多推荐
如何禁用Blazor服务器端预渲染?
发布评论