在 Angular material 设计中是否可以在选项卡中包含选项卡
Is it possible to include tabs within tabs in Angular material design
<md-tabs class="md-primary">
<md-tab label="1">
<md-tab-label>Step 1)</md-tab-label>
<md-tab-body>
<md-tabs>
<md-tab label="1sub">
<md-tab-label>Tab within tab</md-tab-label>
<md-tab-body>
Some tab data
</md-tab-body>
</md-tab>
</md-tabs>
</md-tab-body>
</md-tab>
</md-tabs>
是否可以在标签中创建标签?上面最简单的例子(请原谅嵌套)并没有真正起作用,"sub tabs" 将无法正确呈现。标签不起作用,内容未显示。
简答 - 是。
我有同样的问题,并且没有遇到任何问题:
<html lang="en" >
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css">
</head>
<body ng-app="BlankApp" ng-cloak>
<div>
<h1>Tab Demo</h1>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-stretch-tabs>
<md-tab label="Top Level 1">
<h3>Top Level 1 Content</h3>
<md-tabs md-dynamic-height md-stretch-tabs style="padding-left: 5em;">
<md-tab label="Sub-Level 1">
<h4>Top1 Sub1 Content</h4>
</md-tab>
<md-tab label="Sub-Level 2">
<h4>Top1 Sub2 Content</h4>
</md-tab>
<md-tab label="Sub-Level 3">
<h4>Top1 Sub3 Content</h4>
</md-tab>
</md-tabs>
</md-tab>
<md-tab label="Top Level 2">
<h3>Top Level 2 Content</h3>
</md-tab>
<md-tab label="Top Level 3">
<h3>Top Level 3 Content</h3>
<md-tabs md-dynamic-height md-stretch-tabs style="padding-left: 5em;">
<md-tab label="Sub-Level 1">
<h4>Top3 Sub1 Content</h4>
</md-tab>
<md-tab label="Sub-Level 2">
<h4>Top3 Sub2 Content</h4>
</md-tab>
<md-tab label="Sub-Level 3">
<h4>Top3 Sub3 Content</h4>
</md-tab>
</md-tabs>
</md-tab>
</md-tabs>
</md-content>
</div>
<!-- Angular Material requires Angular.js Libraries -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script>
<!-- Angular Material Library -->
<script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script>
<!-- Your application bootstrap -->
<script type="text/javascript">
/**
* You must include the dependency on 'ngMaterial'
*/
angular.module('BlankApp', ['ngMaterial']);
</script>
</body>
</html>
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be in foundin the LICENSE file at http://material.angularjs.org/license.
-->
这应该让你继续。
干杯,
旦
请注意,Material 设计明确不支持嵌套选项卡。参考Material Design - Tabs component's last example or this github discussion: setting class on nested tabs
你应该考虑另一种方法!
<md-tabs class="md-primary">
<md-tab label="1">
<md-tab-label>Step 1)</md-tab-label>
<md-tab-body>
<md-tabs>
<md-tab label="1sub">
<md-tab-label>Tab within tab</md-tab-label>
<md-tab-body>
Some tab data
</md-tab-body>
</md-tab>
</md-tabs>
</md-tab-body>
</md-tab>
</md-tabs>
是否可以在标签中创建标签?上面最简单的例子(请原谅嵌套)并没有真正起作用,"sub tabs" 将无法正确呈现。标签不起作用,内容未显示。
简答 - 是。
我有同样的问题,并且没有遇到任何问题:
<html lang="en" >
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css">
</head>
<body ng-app="BlankApp" ng-cloak>
<div>
<h1>Tab Demo</h1>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-stretch-tabs>
<md-tab label="Top Level 1">
<h3>Top Level 1 Content</h3>
<md-tabs md-dynamic-height md-stretch-tabs style="padding-left: 5em;">
<md-tab label="Sub-Level 1">
<h4>Top1 Sub1 Content</h4>
</md-tab>
<md-tab label="Sub-Level 2">
<h4>Top1 Sub2 Content</h4>
</md-tab>
<md-tab label="Sub-Level 3">
<h4>Top1 Sub3 Content</h4>
</md-tab>
</md-tabs>
</md-tab>
<md-tab label="Top Level 2">
<h3>Top Level 2 Content</h3>
</md-tab>
<md-tab label="Top Level 3">
<h3>Top Level 3 Content</h3>
<md-tabs md-dynamic-height md-stretch-tabs style="padding-left: 5em;">
<md-tab label="Sub-Level 1">
<h4>Top3 Sub1 Content</h4>
</md-tab>
<md-tab label="Sub-Level 2">
<h4>Top3 Sub2 Content</h4>
</md-tab>
<md-tab label="Sub-Level 3">
<h4>Top3 Sub3 Content</h4>
</md-tab>
</md-tabs>
</md-tab>
</md-tabs>
</md-content>
</div>
<!-- Angular Material requires Angular.js Libraries -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script>
<!-- Angular Material Library -->
<script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script>
<!-- Your application bootstrap -->
<script type="text/javascript">
/**
* You must include the dependency on 'ngMaterial'
*/
angular.module('BlankApp', ['ngMaterial']);
</script>
</body>
</html>
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be in foundin the LICENSE file at http://material.angularjs.org/license.
-->
这应该让你继续。
干杯, 旦
请注意,Material 设计明确不支持嵌套选项卡。参考Material Design - Tabs component's last example or this github discussion: setting class on nested tabs
你应该考虑另一种方法!