diff --git a/src/BootstrapBlazor/Components/Step/Step.razor.cs b/src/BootstrapBlazor/Components/Step/Step.razor.cs index 3b8ffa00455..f2e804b278e 100644 --- a/src/BootstrapBlazor/Components/Step/Step.razor.cs +++ b/src/BootstrapBlazor/Components/Step/Step.razor.cs @@ -53,6 +53,11 @@ public partial class Step private int _currentStepIndex; + /// + /// 获得当前步骤索引(只读) + /// + public int CurrentStepIndex => _currentStepIndex; + /// /// 获得 组件样式字符串 /// diff --git a/test/UnitTest/Components/StepTest.cs b/test/UnitTest/Components/StepTest.cs index 027f6e7504d..24ecdad977d 100644 --- a/test/UnitTest/Components/StepTest.cs +++ b/test/UnitTest/Components/StepTest.cs @@ -37,6 +37,8 @@ public void Step_Items() body = cut.FindAll(".step-body-item"); Assert.Empty(body); + + Assert.Equal(0, cut.Instance.CurrentStepIndex); } [Fact]