Skip to content

Commit ef82709

Browse files
momijijinArgoZhang
andauthored
feat(Step): add CurrentStepIndex property (#6316)
* feat(Step): add 'CurrentStepIndex' to obtain the real-time value of _currentStepIndex * test: 增加单元测试 --------- Co-authored-by: Argo Zhang <[email protected]>
1 parent 618b956 commit ef82709

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ public partial class Step
5353

5454
private int _currentStepIndex;
5555

56+
/// <summary>
57+
/// 获得当前步骤索引(只读)
58+
/// </summary>
59+
public int CurrentStepIndex => _currentStepIndex;
60+
5661
/// <summary>
5762
/// 获得 组件样式字符串
5863
/// </summary>

test/UnitTest/Components/StepTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public void Step_Items()
3737

3838
body = cut.FindAll(".step-body-item");
3939
Assert.Empty(body);
40+
41+
Assert.Equal(0, cut.Instance.CurrentStepIndex);
4042
}
4143

4244
[Fact]

0 commit comments

Comments
 (0)