Skip to content

Commit e60b187

Browse files
committed
refactor: 增加条件渲染
1 parent 248d341 commit e60b187

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/BootstrapBlazor/Components/Dropdown/DropdownItem.razor

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ else
1010
{
1111
<DynamicElement class="@ItemClassString"
1212
TriggerClick="!IsDisabled" OnClick="OnClickItem">
13-
<i class="@ItemIconString"></i>
14-
<span>@Text</span>
13+
@if (!string.IsNullOrEmpty(ItemIconString))
14+
{
15+
<i class="@ItemIconString"></i>
16+
}
17+
@if (!string.IsNullOrEmpty(Text))
18+
{
19+
<span>@Text</span>
20+
}
1521
</DynamicElement>
1622
}

0 commit comments

Comments
 (0)