jQuery技术:单击后,Bootstrap下拉列表消失

 

以上是我正在使用的bootstrap + angular下拉代码。 但是一旦我点击了下拉列表,它就会消失。 我正在使用angular1 + boostrap 3.3.7和jquery 1.12.4库。 没有使用其他脚本或js。

以下是角度函数

 app.controller("serviceHistoryController",function($scope){ let menuitems = [{"sutid":"1","name":"AA"}, {"sutid":"2","name":"BB"}, {"sutid":"3","name":"CC"}, {"sutid":"4","name":"DD"}, {"sutid":"4","name":"EE"}] $scope.sutlist = menuitems; $scope.selectedSUT; $scope.sutselected = function(sutname){ $scope.selectedSUT = sutname; alert("dropdown sut selected:"+$scope.selectedSUT.name); } }); 

    问题在于您的数据类型让我们使用var查看修改后的控制器。

     app.controller("serviceHistoryController",function($scope){ var menuitems = [{"sutid":"1","name":"AA"}, {"sutid":"2","name":"BB"}, {"sutid":"3","name":"CC"}, {"sutid":"4","name":"DD"}, {"sutid":"4","name":"EE"}] $scope.sutlist = menuitems; $scope.selectedSUT; $scope.sutselected = function(sutname){ $scope.selectedSUT = sutname; alert("dropdown sut selected:"+$scope.selectedSUT.name); } }); 

    请参阅

    需要了解更多jQuery教程分享单击后,Bootstrap下拉列表消失,都可以关注jQuery技术分享栏目—计算机技术网(www.ctvol.com)!

     var app = angular.module('main', []); app.controller("serviceHistoryController",function($scope){ var menuitems = [{"sutid":"1","name":"AA"}, {"sutid":"2","name":"BB"}, {"sutid":"3","name":"CC"}, {"sutid":"4","name":"DD"}, {"sutid":"4","name":"EE"}] $scope.sutlist = menuitems; $scope.selectedSUT; $scope.sutselected = function(sutname){ $scope.selectedSUT = sutname; alert("dropdown sut selected:"+$scope.selectedSUT.name); } }); 
         
    Normal :

      以上就是jQuery教程分享单击后,Bootstrap下拉列表消失相关内容,想了解更多jQuery开发(异常处理)及jQuery教程关注计算机技术网(www.ctvol.com)!)。

      本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

      ctvol管理联系方式QQ:251552304

      本文章地址:https://www.ctvol.com/jquerytutorial/981124.html

      (0)
      上一篇 2021年12月12日
      下一篇 2021年12月12日

      精彩推荐