blazor中的RenderMode.Server和RenderMode.ServerPrerendered有什么区别? [英] What's the difference between RenderMode.Server and RenderMode.ServerPrerendered in blazor?

查看:801
本文介绍了blazor中的RenderMode.Server和RenderMode.ServerPrerendered有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者之间有什么区别

@(await Html.RenderComponentAsync<Todo>(RenderMode.ServerPrerendered))

@(await Html.RenderComponentAsync<Todo>(RenderMode.Server))

我正在研究文档,但找不到真正能解释差异的东西.而且也不太理解枚举中的代码注释:

I was looking into the documentation but couldn't really find something that explains the difference. and also don't really understand the code comments over the enum stating:

    // Summary:
    //     Renders a marker for a Blazor server-side application. This doesn't include any
    //     output from the component. When the user-agent starts, it uses this marker to
    //     bootstrap a blazor application.
    Server = 2,
    //
    // Summary:
    //     Renders the component into static HTML and includes a marker for a Blazor server-side
    //     application. When the user-agent starts, it uses this marker to bootstrap a blazor
    //     application.
    ServerPrerendered = 3

幕后发生了什么? 以及使用Server vs ServerPrerendered的方案是什么?

What is happening behind the scenes? And what are the Scenarios for using Server vs ServerPrerendered?

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆