refactor(Split): update javascript make min/max correct (#4184)

* fix: 更新逻辑

* doc: 更正示例锚点

* doc: 更新文档

* doc: 更新示例文档
This commit is contained in:
Argo Zhang 2024-08-30 10:06:56 +08:00 committed by GitHub
parent f0e630abb0
commit 8ae4b5dac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@
<DemoBlock Title="@Localizer["SplitsMinimumTitle"]"
Introduction="@Localizer["SplitsMinimumIntro"]"
Name="Basis">
Name="Minimum">
<div class="border split-demo split-demo-horizontal">
<Split Basis="40%" FirstPaneMinimumSize="48px" SecondPaneMinimumSize="48px" IsCollapsible="true">
<FirstPaneTemplate>

View File

@ -1759,7 +1759,7 @@
"SplitsNestedTitle": "Nested use",
"SplitsNestedIntro": "Combine layout by nesting <code>Split</code> components",
"SplitsMinimumTitle": "Minimum",
"SplitsMinimumIntro": "By setting <code>FirstPaneMinimumSize</code> <code>SecondPaneMinimumSize</code> values",
"SplitsMinimumIntro": "By setting <code>FirstPaneMinimumSize</code> <code>SecondPaneMinimumSize</code> values. In this example, the minimum values of the left and right panels are set to <code>10%</code>",
"SplitsPanel5": "Upper",
"SplitsPanel6": "Lower",
"SplitsPanel7": "Right",

View File

@ -1759,7 +1759,7 @@
"SplitsNestedTitle": "嵌套使用",
"SplitsNestedIntro": "通过嵌套 <code>Split</code> 组件进行组合布局",
"SplitsMinimumTitle": "最小值",
"SplitsMinimumIntro": "通过设置 <code>FirstPaneMinimumSize</code> <code>SecondPaneMinimumSize</code> 值限制面板最小尺寸,支持所有单位",
"SplitsMinimumIntro": "通过设置 <code>FirstPaneMinimumSize</code> <code>SecondPaneMinimumSize</code> 值限制面板最小尺寸,支持所有单位。本例中设置左右面板最小值均为 <code>10%</code>",
"SplitsPanel5": "上边面板",
"SplitsPanel6": "下边面板",
"SplitsPanel7": "右边面板",

View File

@ -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