Skip to content

Commit 863a208

Browse files
authored
doc(Select): update ShowSwal sample code (#6248)
* refactor: 更新示例 * doc: 更新文档
1 parent b7e67a8 commit 863a208

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/BootstrapBlazor.Server/Components/Samples/Selects.razor

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,15 @@
364364
<DemoBlock Title="@Localizer["SelectsConfirmSelectTitle"]"
365365
Introduction="@Localizer["SelectsConfirmSelectIntro"]"
366366
Name="ConfirmSelect">
367+
<section ignore>
368+
<ul class="ul-demo">
369+
<li>@((MarkupString)Localizer["SelectConfifrmSelectDesc1"].Value)</li>
370+
<li>@((MarkupString)Localizer["SelectConfifrmSelectDesc2"].Value)</li>
371+
</ul>
372+
</section>
367373
<div class="row">
368374
<div class="col-12 col-sm-6">
369-
<Select TValue="string" Items="Items" OnBeforeSelectedItemChange="@OnBeforeSelectedItemChange"
375+
<Select TValue="string" Items="Items" ShowSwal="true"
370376
SwalTitle="@Localizer["SwalTitle"]" SwalContent="@Localizer["SwalContent"]" SwalFooter="@Localizer["SwalFooter"]" />
371377
</div>
372378
</div>

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,9 @@
32193219
"SelectsShowSearchTitle": "Drop-down box with search box",
32203220
"SelectsShowSearchIntro": "Controls whether the search box is displayed by setting the <code>ShowSearch</code> property, which is not displayed by default <b>false</b>. You can set the <code>IsAutoClearSearchTextWhenCollapsed</code> parameter to control whether the text in the search box is automatically cleared after the drop-down box is collapsed. The default value is <b>false</b>.",
32213221
"SelectsConfirmSelectTitle": "Drop-down box with confirmation",
3222-
"SelectsConfirmSelectIntro": "Block changes to the current value by setting the <code>OnBeforeSelectedItemChange</code> delegate.",
3222+
"SelectsConfirmSelectIntro": "Prevent the current value from changing by setting the <code>OnBeforeSelectedItemChange</code> delegate or setting the <code>ShowSwal</code> parameter to <code>true</code>.",
3223+
"SelectConfifrmSelectDesc1": "Set the <code>OnBeforeSelectedItemChange</code> callback method, and pop up a window in the callback method to confirm whether to change the value. If it returns <code>true</code>, the value will be changed, otherwise it will not be changed.",
3224+
"SelectConfifrmSelectDesc2": "Set <code>ShowSwal=\"true\"</code> and then confirm the value of the <code>SwalTitle</code> <code>SwalContent</code> parameter using the built-in popup window. In the callback method, you can confirm whether to change the value.",
32233225
"SelectsTimeZoneTitle": "Timezone",
32243226
"SelectsTimeZoneIntro": "Display data of Timezone",
32253227
"SwalTitle": "The drop-down box value changes",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,9 @@
32193219
"SelectsShowSearchTitle": "带搜索框的下拉框",
32203220
"SelectsShowSearchIntro": "通过设置 <code>ShowSearch</code> 属性控制是否显示搜索框,默认为 <b>false</b> 不显示搜索框,可以通过设置 <code>IsAutoClearSearchTextWhenCollapsed</code> 参数控制下拉框收起后是否自动清空搜索框内文字,默认值为 <b>false</b> 不清空",
32213221
"SelectsConfirmSelectTitle": "带确认的下拉框",
3222-
"SelectsConfirmSelectIntro": "通过设置 <code>OnBeforeSelectedItemChange</code> 委托,阻止当前值的改变",
3222+
"SelectsConfirmSelectIntro": "通过设置 <code>OnBeforeSelectedItemChange</code> 委托或者设置 <code>ShowSwal</code> 参数值为 <code>true</code>,阻止当前值的改变。",
3223+
"SelectConfifrmSelectDesc1": "设置 <code>OnBeforeSelectedItemChange</code> 回调方法,在回调方法内自己弹窗确认是否更改值,返回 <code>true</code> 时更改,否则不更改",
3224+
"SelectConfifrmSelectDesc2": "设置 <code>ShowSwal=\"true\"</code> 然后通过设置 <code>SwalTitle</code> <code>SwalContent</code> 参数值使用内置弹窗进行确认即可,在回调方法内自己弹窗确认是否更改值",
32233225
"SelectsTimeZoneTitle": "时区下拉框",
32243226
"SelectsTimeZoneIntro": "下拉框展现时区数据",
32253227
"SwalTitle": "下拉框值变更",

0 commit comments

Comments
 (0)