feat: Blazor 下拉框组件支持 Disabled 属性 默认为 false
#Comment comment #BUGID #Issue close link fix https://gitee.com/LongbowEnterprise/dashboard/issues?id=BUGID # 样式 : feat(location): 接入登录API # # 登录功能与服务器对接 # <type>(<scope>): <subject> <body> <footer> #其中 type 的值可以有 # feat: 新功能 # fix: 修复bug # doc: 文档改变 # style: 代码格式改变 # refactor: 某个已有功能重构 # perf: 性能优化 # test: 增加测试 # build: 改变了build工具 如 grunt 换成了 npm # revert: 撤销上一次的 commit # db: 数据库文件或者脚本更改 # #scope: 用来说明此次修改的影响范围 # all: 表示影响面大 ,如修改了网络框架 会对真个程序产生影响 # location: 表示影响小,某个小小的功能 # module: 表示会影响某个模块 如登录模块、首页模块 、用户管理模块等等 # #subject: 用来简要描述本次改动,概述就好了 # #body: 具体的修改信息 应该尽量详细 # #footer: 放置写备注啥的,如果是 bug ,可以把bug id放入 #
This commit is contained in:
parent
49cdbbb3f7
commit
5b3fea70eb
|
@ -11,7 +11,7 @@ namespace Bootstrap.Admin.Components
|
|||
public class SelectBase<TItem> : ValidateInputBase<TItem>
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// 获得/设置 Select 组件 列样式 默认 col-sm-6
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string ColumnClass { get; set; } = "col-sm-6";
|
||||
|
@ -28,7 +28,13 @@ namespace Bootstrap.Admin.Components
|
|||
public List<SelectedItem> Items { get; set; } = new List<SelectedItem>();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 获得/设置 是否禁用
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool Disabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OnParametersSet 方法
|
||||
/// </summary>
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
|
@ -40,7 +46,7 @@ namespace Bootstrap.Admin.Components
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// OnInitialized 方法
|
||||
/// </summary>
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
@ -52,13 +58,13 @@ namespace Bootstrap.Admin.Components
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// SelectedItemChanged 方法
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Action<SelectedItem>? SelectedItemChanged { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 下拉框项被选中时调用此方法
|
||||
/// </summary>
|
||||
public void ItemClickCallback(SelectedItem item)
|
||||
{
|
||||
|
|
|
@ -3,8 +3,15 @@
|
|||
|
||||
<div class="@($"form-group {ColumnClass}")">
|
||||
<label class="control-label" for="@Id">@DisplayName</label>
|
||||
<div data-toggle="lgbSelect" class="form-select dropdown">
|
||||
<input type="text" readonly="readonly" class="form-control form-select-input" id="@Id" data-toggle="dropdown" placeholder="@PlaceHolder" value="@SelectedItem.Text" />
|
||||
<div data-toggle="lgbSelect" class="@(Disabled ? "form-select dropdown is-disabled" : "form-select dropdown")">
|
||||
@if(Disabled)
|
||||
{
|
||||
<input type="text" readonly="readonly" class="form-control form-select-input" disabled id="@Id" data-toggle="dropdown" placeholder="@PlaceHolder" value="@SelectedItem.Text" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" readonly="readonly" class="form-control form-select-input" id="@Id" data-toggle="dropdown" placeholder="@PlaceHolder" value="@SelectedItem.Text" />
|
||||
}
|
||||
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
|
||||
<div class="dropdown-menu-arrow"></div>
|
||||
<div class="dropdown-menu">
|
||||
|
|
Loading…
Reference in New Issue