AngularJs的UI组件ui-Bootstrap---tabs控件

tabs控件使用uib-tabset指令和uib-tab指令,效果是这样的:

 1 <!DOCTYPE html>
 2 <html ng-app="ui.bootstrap.demo" xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5     <link href="/Content/bootstrap.css" rel="stylesheet" />
 6     <title></title>
 7 
 8     <script src="/Scripts/angular.js"></script>
 9     <script src="/Scripts/ui-bootstrap-tpls-1.3.2.js"></script>
10     <script>
11 
12         angular.module('ui.bootstrap.demo', ['ui.bootstrap']).controller('TabsDemoCtrl', function ($scope, $window) {
13             $scope.tabs = [
14               { title: '标签页a', content: '标签页a的内容' },
15               { title: '标签页b', content: '标签页b的内容', disabled: true }
16             ];
17 
18             $scope.alertMe = function () {
19                 setTimeout(function () {
20                     $window.alert('clicked!');
21                 });
22             };
23         });
24     </script>
25 </head>
26 <body>
27     <div ng-controller="TabsDemoCtrl">
28         <uib-tabset active="active" type="tabs">
29             <uib-tab index="0" heading="标签页1">内容1</uib-tab>
30             <uib-tab index="$index + 1" ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled">
31                 {{tab.content}}
32             </uib-tab>
33             <uib-tab index="3" select="alertMe()">
34                 <uib-tab-heading>
35                     <i class="glyphicon glyphicon-bell"></i> Alert!
36                 </uib-tab-heading>
37                 内容部分
38             </uib-tab>
39         </uib-tabset>
40     </div>
41 </body>
42 </html>

uib-tabset可使用的属性有:


uib-tab可使用的属性有:

如果面板的标题是简单的文本,使用heading属性就足够了。如果是复杂的内容,比如有图标,那么可以使用uib-tab-heading。这一点和According控件是一样的。

转载于:https://www.cnblogs.com/xuepei/p/5970214.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值