標籤:url meta cal xmlns timeout 控制項 並且 function time
原文地址:http://www.cnblogs.com/pilixiami/p/5635137.html
tabs控制項使用uib-tabset指令和uib-tab指令,效果是這樣的:
<!DOCTYPE html><html ng-app="ui.bootstrap.demo" xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="/Content/bootstrap.css" rel="stylesheet" /> <title></title> <script src="/Scripts/angular.js"></script> <script src="/Scripts/ui-bootstrap-tpls-1.3.2.js"></script> <script> angular.module(‘ui.bootstrap.demo‘, [‘ui.bootstrap‘]).controller(‘TabsDemoCtrl‘, function ($scope, $window) { $scope.tabs = [ { title: ‘標籤頁a‘, content: ‘標籤頁a的內容‘ }, { title: ‘標籤頁b‘, content: ‘標籤頁b的內容‘, disabled: true } ]; $scope.alertMe = function () { setTimeout(function () { $window.alert(‘clicked!‘); }); }; }); </script></head><body> <div ng-controller="TabsDemoCtrl"> <uib-tabset active="active" type="tabs"> <uib-tab index="0" heading="標籤頁1">內容1</uib-tab> <uib-tab index="$index + 1" ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled"> {{tab.content}} </uib-tab> <uib-tab index="3" select="alertMe()"> <uib-tab-heading> <i class="glyphicon glyphicon-bell"></i> Alert! </uib-tab-heading> 內容部分 </uib-tab> </uib-tabset> </div></body></html>
uib-tabset可使用的屬性有:
|
屬性名稱 |
預設值 |
備忘 |
|
active |
第一個標籤頁的索引 |
當前啟用的標籤頁的索引 |
|
justified |
false |
是否將各個標籤頁等寬分布在父容器中 |
|
template-url |
uib/template/tabs/tabset.html |
|
|
type |
tabs |
標籤頁的類型。可設定為tabs或pills |
|
vertical |
false |
是否垂直顯示 |
uib-tab可使用的屬性有:
|
屬性名稱 |
預設值 |
備忘 |
|
classes |
|
可添加用空格分隔的類名 |
|
deselect |
|
標籤頁面板取消選中時(啟用其他標籤頁)觸發的函數。支援傳入事件對象參數$event,並且可以用$event.preventDefault()取消操作。 |
|
disable |
false |
是否禁用 |
|
heading |
|
標籤網頁標題的文本 |
|
index |
|
標籤頁的索引。每個索引必須唯一 |
|
select |
|
標籤頁選中時觸發的函數。支援傳入事件對象參數$event,並且可以用$event.preventDefault()取消操作。 |
|
template-url |
uib/template/tabs/tab.html |
|
如果面板的標題是簡單的文本,使用heading屬性就足夠了。如果是複雜的內容,比如有表徵圖,那麼可以使用uib-tab-heading。這一點和According控制項是一樣的。
AngularJs的UI組件ui-Bootstrap分享(六)——Tabs