From 8f078a95551d6892c75c9f558c705d829b1bb2d8 Mon Sep 17 00:00:00 2001 From: momiji-x670ei <2648863351@qq.com> Date: Thu, 26 Jun 2025 16:52:39 +0800 Subject: [PATCH 1/2] feat(Step): add 'CurrentStepIndex' to obtain the real-time value of _currentStepIndex --- src/BootstrapBlazor/Components/Step/Step.razor.cs | 5 +++++ 1 file changed, 5 insertions(+) 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; + /// /// 获得 组件样式字符串 /// From 4f6a39afa21d237896423579c8135de214daf8bc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 29 Jun 2025 09:01:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/StepTest.cs | 2 ++ 1 file changed, 2 insertions(+) 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]