
Component label
This set of components includes ValidateForm
EditorForm
and a variety of Form components inherited from ValidateBase<TValue>
. Among these components There is a special set of display front label logic, now let’s sort it out in a unified way:
- The ValidateForm component is a verifiable form component. The form component in this component will automatically perform data compliance checks. If Data non-compliance will prevent the Submit action, which is the most frequently used component in data submission
- The EditorForm component is an ordinary form component. After this component is bound to the
Model
, the entire form can be automatically generated, which greatly reduces repetition Code, put theValidateForm
on the outside to open the data compliance check very convenient, concise and efficient
Take the BootstrapInput input box component as an example to explain whether to display the Label
logic
Suitable for data entry
Demo
When two-way binding is not used
Label
will not be displayed by default- Control whether to display through the
ShowLabel
property - Display content when setting
DisplayText
- When not set, render a contentless
label
component as a placeholder
ShowLabel='true' DisplayText=``
displays a placeholder label without contentShowLabel='true' DisplayText='Name'
shows the set content labelShowLabel='true' DisplayText='@null'
displays a placeholder label without contentWhen using two-way binding
@bind-Value='Dummy.Name'
, no label is displayed@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@Localizer[nameof(Foo.Address)]'
Display the contents of the setting@bind-Value='Dummy.Name' ShowLabel='true' DisplayText=``
Show no content placeholder label@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@null'
Display the label content under the resource file mechanismLabel
code>Not used in ValidateForm
Demo
Show label
ShowLabel
property of the true
. All components display tagsDo not display labels
ShowLabel="false"
, all form components in the component Do not display tagsAlignment
LabelAlign="Alignment.Right"
set the label alignment is rightAlignment
LabelAlign="Alignment.Center"
set the label alignment is centerUsed in external ValidateForm
Demo
Show label
ShowLabel
property of the true
. All components display tagsDo not display labels
ShowLabel="false"
, all form components in the component Do not display tagsShow labels are automatically turned on by default
Demo
Show label
ShowLabel
property of the true
. All components display tagsDo not display labels
ShowLabel="false"
, all form components in the component Do not display tagsShow labels
form-inline
for the all labels within the component are prefixedRight
form-inline-end
set the label alignment is rightCenter
form-inline-center
set the label alignment is centerTooltip
120px
. If you need more, please change the style variable --bb-row-label-width
in the project style file or remove RowType.Inline
ShowLabelTooltip
in the form-inline
style to true
to make the mouse hover over the cropped label to display the complete informationB station related video link
交流群