Skip to content

Commit 19f6dfe

Browse files
authored
feat(Step): Prev Next function return step index (#5376)
* doc: 更新注释文档 * refactor: 向前一步方法返回当前步骤索引值 * feat: 向后一步方法返回当前步骤索引值
1 parent 459ea17 commit 19f6dfe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/BootstrapBlazor/Components/Step/Step.razor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,29 +116,31 @@ protected override void OnParametersSet()
116116
}
117117

118118
/// <summary>
119-
/// 上一步
119+
/// 移动到上一步方法 返回当前 StepIndex 值
120120
/// </summary>
121-
public void Prev()
121+
public int Prev()
122122
{
123123
_currentStepIndex = Math.Max(0, _currentStepIndex - 1);
124124
StateHasChanged();
125+
return _currentStepIndex;
125126
}
126127

127128
/// <summary>
128-
/// 下一步
129+
/// 移动到下一步方法 返回当前 StepIndex 值
129130
/// </summary>
130-
public async Task Next()
131+
public async Task<int> Next()
131132
{
132133
_currentStepIndex = Math.Min(Items.Count, _currentStepIndex + 1);
133134
if (IsFinished && OnFinishedCallback != null)
134135
{
135136
await OnFinishedCallback();
136137
}
137138
StateHasChanged();
139+
return _currentStepIndex;
138140
}
139141

140142
/// <summary>
141-
/// 下一步
143+
/// 重置步骤方法
142144
/// </summary>
143145
public void Reset()
144146
{

0 commit comments

Comments
 (0)