From 8ae4b5dac655239f7e01f7c1ebe2d449c23ebeac Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 30 Aug 2024 10:06:56 +0800 Subject: [PATCH] refactor(Split): update javascript make min/max correct (#4184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 更新逻辑 * doc: 更正示例锚点 * doc: 更新文档 * doc: 更新示例文档 --- src/BootstrapBlazor.Server/Components/Samples/Splits.razor | 2 +- src/BootstrapBlazor.Server/Locales/en-US.json | 2 +- src/BootstrapBlazor.Server/Locales/zh-CN.json | 2 +- src/BootstrapBlazor/Components/Split/Split.razor.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Splits.razor b/src/BootstrapBlazor.Server/Components/Samples/Splits.razor index 557254aba..b7d22ff81 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Splits.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Splits.razor @@ -109,7 +109,7 @@ + Name="Minimum">
diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index d97c6e90c..36eaff897 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -1759,7 +1759,7 @@ "SplitsNestedTitle": "Nested use", "SplitsNestedIntro": "Combine layout by nesting Split components", "SplitsMinimumTitle": "Minimum", - "SplitsMinimumIntro": "By setting FirstPaneMinimumSize SecondPaneMinimumSize values", + "SplitsMinimumIntro": "By setting FirstPaneMinimumSize SecondPaneMinimumSize values. In this example, the minimum values ​​of the left and right panels are set to 10%", "SplitsPanel5": "Upper", "SplitsPanel6": "Lower", "SplitsPanel7": "Right", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 93a38cbd7..9430703c7 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -1759,7 +1759,7 @@ "SplitsNestedTitle": "嵌套使用", "SplitsNestedIntro": "通过嵌套 Split 组件进行组合布局", "SplitsMinimumTitle": "最小值", - "SplitsMinimumIntro": "通过设置 FirstPaneMinimumSize SecondPaneMinimumSize 值限制面板最小尺寸,支持所有单位", + "SplitsMinimumIntro": "通过设置 FirstPaneMinimumSize SecondPaneMinimumSize 值限制面板最小尺寸,支持所有单位。本例中设置左右面板最小值均为 10%", "SplitsPanel5": "上边面板", "SplitsPanel6": "下边面板", "SplitsPanel7": "右边面板", diff --git a/src/BootstrapBlazor/Components/Split/Split.razor.js b/src/BootstrapBlazor/Components/Split/Split.razor.js index 31f526a48..2d5b88645 100644 --- a/src/BootstrapBlazor/Components/Split/Split.razor.js +++ b/src/BootstrapBlazor/Components/Split/Split.razor.js @@ -49,7 +49,7 @@ export function init(id, invoke, method, option) { const min = getMin(split); let max = getMax(split); - if (min < 100 - max) { + if (min + 0.01 < 100 - max) { max = 100; } if (newVal <= min) newVal = min