feat(module: form): add Required paramater (#353)

This commit is contained in:
zxyao 2020-07-13 20:37:06 +08:00 committed by GitHub
parent 0da743fab2
commit 503415ea07
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@
@if (!string.IsNullOrEmpty(Label))
{
<AntDesign.Col @attributes="GetLabelColAttributes()" class=@($"{_prefixCls}-label")>
<label class=@(_labelCls)> @(Label)</label>
<label class=@(Required ? $"{_prefixCls}-required" : _labelCls)> @(Label)</label>
</AntDesign.Col>
}
<AntDesign.Col @attributes="GetWrapperColAttributes()" class=@($"{_prefixCls}-control")>

View File

@ -39,6 +39,9 @@ namespace AntDesign
[Parameter]
public bool NoStyle { get; set; } = false;
[Parameter]
public bool Required { get; set; } = false;
private EditContext EditContext => Form?.EditContext;
private bool _isValid = true;