我想知道在Semantic-UI中选择一个Item后,如何保持默认下拉按钮值不变?我的问题是,当我选择一个项目时,默认按钮会保留所选项目的值(或文本)。
这是我的代码:
<div class="ui blue labeled icon top left pointing dropdown button" id="#top_panel_dropdown">
<i class="icon basic user" ></i>
<span class="text" >Hi, Dear John</span>
<div class="menu" >
<div class="item">Settings</div>
<div class="item">Profile</div>
<div class="item">Logout</div>
</div>
</div>
和我的jQuery:
$('#top_panel_dropdown').on('click', function() {
$('#top_panel_dropdown').dropdown('toggle');
});
答案 0 :(得分:3)
只需删除span class =“text”,如下所示:
<div class="ui blue labeled icon top left pointing dropdown button" id="#top_panel_dropdown">
<i class="icon basic user" ></i>
Hi, Dear John
<div class="menu" >
<div class="item">Settings</div>
<div class="item">Profile</div>
<div class="item">Logout</div>
</div>
</div>