-
-
Notifications
You must be signed in to change notification settings - Fork 385
doc(Select): add DefaultVirtualizeItemText parameter sample code #7294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| @page "/select" | ||||||
| @page "/select" | ||||||
| @inject DialogService Dialog | ||||||
| @inject IStringLocalizer<Selects> Localizer | ||||||
| @inject IOptions<WebsiteOptions> WebsiteOption | ||||||
|
|
@@ -366,8 +366,8 @@ | |||||
| Name="ConfirmSelect"> | ||||||
| <section ignore> | ||||||
| <ul class="ul-demo"> | ||||||
| <li>@((MarkupString)Localizer["SelectConfifrmSelectDesc1"].Value)</li> | ||||||
| <li>@((MarkupString)Localizer["SelectConfifrmSelectDesc2"].Value)</li> | ||||||
| <li>@((MarkupString)Localizer["SelectConfirmSelectDesc1"].Value)</li> | ||||||
| <li>@((MarkupString)Localizer["SelectConfirmSelectDesc2"].Value)</li> | ||||||
| </ul> | ||||||
| </section> | ||||||
| <div class="row"> | ||||||
|
|
@@ -452,22 +452,24 @@ | |||||
| <p class="code-label">1. 使用 OnQueryAsync 作为数据源</p> | ||||||
| <div class="row mb-3"> | ||||||
| <div class="col-6"> | ||||||
| <Select IsVirtualize="true" OnQueryAsync="OnQueryAsync" @bind-Value="VirtualItem1" | ||||||
| <Select IsVirtualize="true" OnQueryAsync="OnQueryAsync" @bind-Value="_virtualItem1" | ||||||
| DefaultVirtualizeItemText="@VirtualItemText1" | ||||||
| ShowSearch="_showSearch" IsClearable="_isClearable"></Select> | ||||||
| </div> | ||||||
| <div class="col-6"> | ||||||
| <Display TValue="string" Value="@VirtualItem1?.Text"></Display> | ||||||
| <Display TValue="int?" Value="@_virtualItem1"></Display> | ||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
| <p class="code-label">2. 使用 Items 作为数据源</p> | ||||||
| <div class="row"> | ||||||
| <div class="col-6"> | ||||||
| <Select IsVirtualize="true" Items="VirtualItems" @bind-Value="VirtualItem2" | ||||||
| <Select IsVirtualize="true" Items="VirtualItems" @bind-Value="_virtualItem2" | ||||||
|
||||||
| <Select IsVirtualize="true" Items="VirtualItems" @bind-Value="_virtualItem2" | |
| <Select TValue="int?" IsVirtualize="true" Items="VirtualItems" @bind-Value="_virtualItem2" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3030,8 +3030,8 @@ | |||||
| "SelectsShowSearchIntro": "通过设置 <code>ShowSearch</code> 属性控制是否显示搜索框,默认为 <b>false</b> 不显示搜索框,可以通过设置 <code>IsAutoClearSearchTextWhenCollapsed</code> 参数控制下拉框收起后是否自动清空搜索框内文字,默认值为 <b>false</b> 不清空", | ||||||
| "SelectsConfirmSelectTitle": "带确认的下拉框", | ||||||
| "SelectsConfirmSelectIntro": "通过设置 <code>OnBeforeSelectedItemChange</code> 委托或者设置 <code>ShowSwal</code> 参数值为 <code>true</code>,阻止当前值的改变。", | ||||||
| "SelectConfifrmSelectDesc1": "设置 <code>OnBeforeSelectedItemChange</code> 回调方法,在回调方法内自己弹窗确认是否更改值,返回 <code>true</code> 时更改,否则不更改", | ||||||
| "SelectConfifrmSelectDesc2": "设置 <code>ShowSwal=\"true\"</code> 然后通过设置 <code>SwalTitle</code> <code>SwalContent</code> 参数值使用内置弹窗进行确认即可,在回调方法内自己弹窗确认是否更改值", | ||||||
| "SelectConfirmSelectDesc1": "设置 <code>OnBeforeSelectedItemChange</code> 回调方法,在回调方法内自己弹窗确认是否更改值,返回 <code>true</code> 时更改,否则不更改", | ||||||
| "SelectConfirmSelectDesc2": "设置 <code>ShowSwal=\"true\"</code> 然后通过设置 <code>SwalTitle</code> <code>SwalContent</code> 参数值使用内置弹窗进行确认即可,在回调方法内自己弹窗确认是否更改值", | ||||||
| "SelectsTimeZoneTitle": "时区下拉框", | ||||||
| "SelectsTimeZoneIntro": "下拉框展现时区数据", | ||||||
| "SwalTitle": "下拉框值变更", | ||||||
|
|
@@ -3064,7 +3064,7 @@ | |||||
| "SelectsIsEditableDesc": "开启可编辑功能后,输入值如果候选项中没有时,可以通过 <code>TextConvertToValueCallback</code> 回调方法返回新值,可以通过 <code>OnInputChangedCallback</code> 回调对 <code>Items</code> 数据源进行更新,防止页面刷新后输入值丢失", | ||||||
| "SelectsVirtualizeTitle": "虚拟滚动", | ||||||
| "SelectsVirtualizeIntro": "通过设置 <code>IsVirtualize</code> 参数开启组件虚拟功能特性", | ||||||
| "SelectsVirtualizeDescription": "组件虚拟滚动支持两种形式通过 <code>Items</code> 或者 <code>OnQueryAsync</code> 回调方法提供数据", | ||||||
| "SelectsVirtualizeDescription": "组件虚拟滚动支持两种形式通过 <code>Items</code> 或者 <code>OnQueryAsync</code> 回调方法提供数据。如果数据源使用 <code>OnQueryAsync</code> 回调获得时只有当下拉框展开时才会触发,,如果数据源使用 <code>Items</code> 时,由于性能问题(有些开发会把几百万条数据给 Items)内部并没有进行查找选中项,所以需要设置 <code>DefaultVirtualizeItemText</code> 值应对首次加载时不知道如何显示问题", | ||||||
|
||||||
| "SelectsVirtualizeDescription": "组件虚拟滚动支持两种形式通过 <code>Items</code> 或者 <code>OnQueryAsync</code> 回调方法提供数据。如果数据源使用 <code>OnQueryAsync</code> 回调获得时只有当下拉框展开时才会触发,,如果数据源使用 <code>Items</code> 时,由于性能问题(有些开发会把几百万条数据给 Items)内部并没有进行查找选中项,所以需要设置 <code>DefaultVirtualizeItemText</code> 值应对首次加载时不知道如何显示问题", | |
| "SelectsVirtualizeDescription": "组件虚拟滚动支持两种形式通过 <code>Items</code> 或者 <code>OnQueryAsync</code> 回调方法提供数据。如果数据源使用 <code>OnQueryAsync</code> 回调获得时只有当下拉框展开时才会触发,如果数据源使用 <code>Items</code> 时,由于性能问题(有些开发会把几百万条数据给 Items)内部并没有进行查找选中项,所以需要设置 <code>DefaultVirtualizeItemText</code> 值应对首次加载时不知道如何显示问题", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Select component is missing the TValue generic parameter specification. While type inference may work in some cases, it's best practice to explicitly declare TValue for clarity and to avoid potential type inference issues. Consider adding TValue="int?" to match the binding type.