Skip to content

Commit 3aabbca

Browse files
committed
Revert "refactor: 更改 FirstRender 参数值逻辑"
This reverts commit 161471a.
1 parent 58be1e3 commit 3aabbca

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ public partial class DockViewV2 : IDisposable
172172
[NotNull]
173173
private DockViewOptions? _options = null;
174174
private ConcurrentDictionary<string, DockViewComponentState> _componentStates = new();
175-
private bool _firstLoad = true;
176175

177176
/// <summary>
178177
/// <inheritdoc/>
@@ -204,9 +203,9 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
204203
/// <summary>
205204
/// <inheritdoc />
206205
/// </summary>
207-
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, GetOptions());
206+
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, GetOptions(true));
208207

209-
private DockViewConfig GetOptions() => new()
208+
private DockViewConfig GetOptions(bool firstRender = false) => new()
210209
{
211210
EnableLocalStorage = EnableLocalStorage ?? _options.EnableLocalStorage ?? false,
212211
LocalStorageKey = $"{GetPrefixKey()}-{Name}-{GetVersion()}",
@@ -226,7 +225,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
226225
SplitterCallback = nameof(SplitterCallbackAsync),
227226
Contents = _components,
228227
LoadTabs = nameof(LoadTabs),
229-
FirstRender = _firstLoad
228+
FirstRender = firstRender
230229
};
231230

232231
private string GetVersion() => Version ?? _options.Version ?? "v1";
@@ -266,7 +265,6 @@ private Task OnThemeChangedAsync(string themeName)
266265
[JSInvokable]
267266
public async Task InitializedCallbackAsync()
268267
{
269-
_firstLoad = false;
270268
if (OnInitializedCallbackAsync != null)
271269
{
272270
await OnInitializedCallbackAsync();

0 commit comments

Comments
 (0)