共用方式為


IComponentPrerenderer.PrerenderComponentAsync 方法

定義

將 Razor 元件預先呈現為 HTML。

public System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Html.IHtmlAsyncContent> PrerenderComponentAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, Type componentType, Microsoft.AspNetCore.Components.IComponentRenderMode renderMode, Microsoft.AspNetCore.Components.ParameterView parameters);
abstract member PrerenderComponentAsync : Microsoft.AspNetCore.Http.HttpContext * Type * Microsoft.AspNetCore.Components.IComponentRenderMode * Microsoft.AspNetCore.Components.ParameterView -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Html.IHtmlAsyncContent>
Public Function PrerenderComponentAsync (httpContext As HttpContext, componentType As Type, renderMode As IComponentRenderMode, parameters As ParameterView) As ValueTask(Of IHtmlAsyncContent)

參數

httpContext
HttpContext

HttpContext

componentType
Type

要預先呈現的元件類型。 這必須實作 IComponent

renderMode
IComponentRenderMode

要預先呈現元件的模式。

parameters
ParameterView

元件的參數。

傳回

使用預先呈現的內容完成的工作。

適用於