如何在 angularjs material 设计中显示标签标题居中对齐
How to display tabs heading center aligned in angularjs material design
我正在关注此 link 以获取我网页中的选项卡。
https://material.angularjs.org/latest/demo/tabs
这是标签代码。
<div ng-cloak>
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="one">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="three">
<md-content class="md-padding">
<p> Tab 3 contents</p>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</div>
以上代码在 HTML 页面
左侧显示标签标题
如何在 HTML 页面的中心显示标签标题?
我还有一个要求。 tab1 内容中有一个按钮。单击该按钮如何移动到第二个选项卡?
You can use Following link to align centre/left/bottom etc the Heading/any elements
https://material.angularjs.org/latest/layout/alignment
例如:- layout="row" layout-align="center center"
用于将选项卡设置为向导
控制器逻辑:-
$scope.max = 2; // max you can put your number
$scope.selectedIndex = 0;
$scope.nextTab = function() {
var index = ($scope.selectedIndex == $scope.max) ? 0 : $scope.selectedIndex + 1;
$scope.selectedIndex = index;
};
Html :-
<md-tabs md-dynamic-height="" md-border-bottom="" md-selected="selectedIndex" md-center-tabs="true">
.....
</md-tabs>
Plunker 在行动:-
md-center-tabs="true" 为我工作
<md-tabs md-center-tabs="true" md-dynamic-height md-border-bottom class="md-primary" style="border: none;">
我正在关注此 link 以获取我网页中的选项卡。
https://material.angularjs.org/latest/demo/tabs
这是标签代码。
<div ng-cloak>
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="one">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="three">
<md-content class="md-padding">
<p> Tab 3 contents</p>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</div>
以上代码在 HTML 页面
左侧显示标签标题如何在 HTML 页面的中心显示标签标题?
我还有一个要求。 tab1 内容中有一个按钮。单击该按钮如何移动到第二个选项卡?
You can use Following link to align centre/left/bottom etc the Heading/any elements
https://material.angularjs.org/latest/layout/alignment
例如:- layout="row" layout-align="center center"
用于将选项卡设置为向导
控制器逻辑:-
$scope.max = 2; // max you can put your number
$scope.selectedIndex = 0;
$scope.nextTab = function() {
var index = ($scope.selectedIndex == $scope.max) ? 0 : $scope.selectedIndex + 1;
$scope.selectedIndex = index;
};
Html :-
<md-tabs md-dynamic-height="" md-border-bottom="" md-selected="selectedIndex" md-center-tabs="true">
.....
</md-tabs>
Plunker 在行动:-
md-center-tabs="true" 为我工作
<md-tabs md-center-tabs="true" md-dynamic-height md-border-bottom class="md-primary" style="border: none;">