From 8ad943fe704a9073514755285eb68e4b9ea130ac Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 14 Oct 2025 17:26:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20JSObjectRe?= =?UTF-8?q?ference=20=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Region/Components/SelectRegion.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor index 69b3c48d..e6759b13 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor @@ -1,6 +1,6 @@ @namespace BootstrapBlazor.Components @inherits PopoverSelectBase -@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.Region/Components/SelectRegion.razor.js", JSObjectReference = true)] +@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.Region/Components/SelectRegion.razor.js")] @if (IsShowLabel) { From b1e9a882c2e3d94df8c2b082abcba0a6f3cdd5b8 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 15 Oct 2025 09:02:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E7=BB=86?= =?UTF-8?q?=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/SelectRegion.razor.cs | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs index 274f9d68..ee63e0e2 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs @@ -2,8 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ -using Microsoft.AspNetCore.Components; - namespace BootstrapBlazor.Components; /// @@ -177,11 +175,11 @@ private void ResetValue() private async Task OnClearValue() { - _provinceValue = ""; - _cityValue = ""; + _provinceValue = null; + _cityValue = null; _countyValue = new(); - _detailValue = ""; - CurrentValue = ""; + _detailValue = null; + CurrentValue = null; _currentViewMode = RegionViewMode.Province; @@ -226,6 +224,9 @@ private HashSet GetDetails() private void OnClickProvince(string value) { _provinceValue = value; + _cityValue = null; + _countyValue = new(); + _detailValue = null; _currentViewMode = RegionViewMode.City; CurrentValue = _provinceValue; @@ -234,6 +235,8 @@ private void OnClickProvince(string value) private void OnClickCity(string value) { _cityValue = value; + _countyValue = new(); + _detailValue = null; _currentViewMode = RegionViewMode.County; CurrentValue = $"{_provinceValue}-{_cityValue}"; @@ -242,6 +245,7 @@ private void OnClickCity(string value) private void OnClickCounty(CountyItem item) { _countyValue = item; + _detailValue = null; _currentViewMode = RegionViewMode.Detail; CurrentValue = $"{_provinceValue}-{_cityValue}-{_countyValue.Name}"; @@ -259,22 +263,16 @@ private async Task OnClickDetail(string value) private void OnSwitchProvinceView() { _currentViewMode = RegionViewMode.Province; - _cityValue = ""; - _countyValue = new(); - _detailValue = ""; } private void OnSwitchCityView() { _currentViewMode = RegionViewMode.City; - _countyValue = new(); - _detailValue = ""; } private void OnSwitchCountyView() { _currentViewMode = RegionViewMode.County; - _detailValue = ""; } private void OnSwitchDetailView() From fae0a2b0f950001e439e6e2ac6ea632f70cdf195 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 15 Oct 2025 09:04:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Region/Components/SelectRegion.razor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.js b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.js index ed5603a1..245d12fc 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.js +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.js @@ -25,6 +25,6 @@ export function dispose(id) { const { popover } = region; if (popover) { - Popover.dispose(select.popover); + Popover.dispose(popover); } } From 78eee9055221f5b18cae723ea5575c3488b769a4 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 15 Oct 2025 10:38:17 +0800 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Region/BootstrapBlazor.Region.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj b/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj index 9279e3a0..664f20b8 100644 --- a/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj +++ b/src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj @@ -22,6 +22,7 @@ + From 9351a3e0702cc9c91d3cdd10fa506a14b7f22d52 Mon Sep 17 00:00:00 2001 From: Argo Date: Wed, 15 Oct 2025 11:39:12 +0800 Subject: [PATCH 5/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/SelectRegion.razor.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.css b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.css index ef0b2dea..bc73d85a 100644 --- a/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.css +++ b/src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.css @@ -71,12 +71,12 @@ color: #777; } - .bb-region-body ul li.active { - background-color: #e3e3e3; + .bb-region-body ul li:hover { + background-color: #e9ecef; color: #000; } - .bb-region-body ul li:hover { + .bb-region-body ul li.active { background-color: #e3e3e3; color: #000; }