Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/BootstrapBlazor/Components/Step/Step.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,31 @@ protected override void OnParametersSet()
}

/// <summary>
/// 上一步
/// 移动到上一步方法 返回当前 StepIndex 值
/// </summary>
public void Prev()
public int Prev()
{
_currentStepIndex = Math.Max(0, _currentStepIndex - 1);
StateHasChanged();
return _currentStepIndex;
}

/// <summary>
/// 下一步
/// 移动到下一步方法 返回当前 StepIndex 值
/// </summary>
public async Task Next()
public async Task<int> Next()
{
_currentStepIndex = Math.Min(Items.Count, _currentStepIndex + 1);
if (IsFinished && OnFinishedCallback != null)
{
await OnFinishedCallback();
}
StateHasChanged();
return _currentStepIndex;
}

/// <summary>
/// 下一步
/// 重置步骤方法
/// </summary>
public void Reset()
{
Expand Down