ASP.NET Core Razor Component life cycle
Blazor 元件在啟動時會有一連串的事件觸發,然而在元件觸發時會因不同狀況下所觸發的事件有所不同,下列Code可放在Blazor @Code中來做事件的執行順序觀察。 /// <summary> /// 當參數 (設定時 SetParametersAsync) /// </summary> /// <param name="parameters"></param> /// <returns></returns> public override async Task SetParametersAsync(ParameterView parameters) { Console.WriteLine("Trigger SetParametersAsync"); await base.SetParametersAsync(parameters); } /// <summary> /// 元件初始化 /// </summary> protected override void OnInitialized() { Console.WriteLine("Trigger OnInitialized"); base.OnInitialized(); } /// <summary> /// 元件初始化 /// </summary> protected overr...