最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能

來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:33:53
文檔

Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能

Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能: 具體代碼如下所示: find.html <!DOCTYPE html> <html ng-app=find> <head> <title>字符查找</title> <meta charset=utf-8/> <script src=../Script/a
推薦度:
導(dǎo)讀Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能: 具體代碼如下所示: find.html <!DOCTYPE html> <html ng-app=find> <head> <title>字符查找</title> <meta charset=utf-8/> <script src=../Script/a

 具體代碼如下所示:

find.html

<!DOCTYPE html> 
<html ng-app="find"> 
<head> 
<title>字符查找</title> 
<meta charset="utf-8"/> 
<script src="../Script/angular.min.js" type="text/javascript"></script> 
<link rel="stylesheet" href="../bootstrap-3.0.0/css/bootstrap.css" rel="external nofollow" > 
<style type="text/css"> 
 body{ 
 font-size: 12px; 
 } 
 ul{ 
 list-style-type: none; 
 width: 408px; 
 margin:0px; 
 padding: 0px; 
 } 
 ul li { 
 float: left; 
 padding: 5px 0px; 
 } 
 ul .bold { 
 font-weight: bold; 
 cursor: pointer; 
 } 
 ul li span { 
 width: 70px; 
 float: left; 
 padding: 0px 10px; 
 } 
 ul .focus { 
 background-color: #cccccc; 
 } 
</style> 
<script type="text/javascript"> 
 var find = angular.module('find', []); 
 find.controller('find_name', ['$scope', function ($scope) { 
 $scope.bold = "bold"; 
 $scope.key = ''; 
 $scope.data = [ 
 { name: "張小琴", sex: "女", age: 24, score: 95 }, 
 { name: "李清思", sex: "女", age: 27, score: 87 }, 
 { name: "楊旭旭", sex: "男", age: 28, score: 86 }, 
 { name: "陳楚圣", sex: "男", age: 23, score: 97 } 
 ]; 
 }]) 
 </script> 
</head> 
<body> 
 <div ng-controller="find_name" align="center"> 
 <div class="panel panel-primary" align="center" style="height: 300px"> 
 <div class="panel-heading" align="center"> 
 <div class="panel-title" style="font-size: 22px">字符查找</div> 
 </div> 
 <div> 
 <input id="txtkey" type="text" ng-model="key" 
 style="margin-top: 10px; height: 30px;width: 200px;" placeholder="請輸入姓名關(guān)鍵字" /> 
 </div> 
 <ul> 
 <li ng-class="{{bold}}" style="font-size: 16px; margin-top: 5px;"> 
 <span>序號</span> 
 <span>姓名</span> 
 <span>性別</span> 
 <span>年齡</span> 
 <span>分?jǐn)?shù)</span> 
 </li> 
 <li ng-repeat=" stu in data | filter : {name:key}" style="font-size: 16px"> 
 <span>{{$index+1}}</span> 
 <span>{{stu.name}}</span> 
 <span>{{stu.sex}}</span> 
 <span>{{stu.age}}</span> 
 <span>{{stu.score}}</span> 
 </li> 
 </ul> 
 </div> 
 </div> 
</body> 
</html> 

截圖:



以上所述是小編給大家介紹的Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能

Bootstrap + AngularJS 實(shí)現(xiàn)簡單的數(shù)據(jù)過濾字符查找功能: 具體代碼如下所示: find.html <!DOCTYPE html> <html ng-app=find> <head> <title>字符查找</title> <meta charset=utf-8/> <script src=../Script/a
推薦度:
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top