gpt4 book ai didi

javascript - 选择选项上的 Bootstrap 工具提示不起作用

转载 作者:行者123 更新时间:2023-11-28 10:46:16 24 4
gpt4 key购买 nike

我需要为选择框中的每个选项显示一个工具提示

 <select ng-model="rightList" class="form-control" size="13" multiple>
<option
ng-repeat="item in selectedList"
value="{{$index}}"
uib-tooltip="See? Now click away..."
tooltip-placement="right">
{{item.name}}
</option>
</select>

请帮忙。

最佳答案

尝试以下代码:

JS( Controller 中的数据):

$scope.selectedList = [{
id: 1,
name: 'name1',
toolTip:'tooltip one'
}, {
id: 2,
name: 'name2',
toolTip:'tooltip two'
}, {
id: 3,
name: 'name3',
toolTip:'tooltip three'
}];

HTML:

<select>
<option
data-toggle="tooltip"
data-placement="right"
title="{{item.toolTip}}"
ng-repeat="item in selectedList"
value="{{$index}}">
{{item.name}}
</option>
</select>

关于javascript - 选择选项上的 Bootstrap 工具提示不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42338467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com