标签:
用ng-class="{active:vm.activeTab == 1}" 定义在显示的标签里
用ng-class="{active:vm.activeTab == 2}" ng-show="vm.activeTab == 2"定义在隐藏的标签里
ng-show="vm.activeTab == 2"表示隐藏第二个
ng-click="vm.activeTab = 2" 当点击定义了这行代码的标签,显示出隐藏的第二个标签
同理ng-click="vm.activeTab = 1"显示第一个
代码如下:
<ion-header-bar ng-class=="{cative: vm.activeTab == 1}">
<a class="button icon-left" style="color: #fff;" ng-click="vm.activeTab = 2">
<i href="" class="icon ion-ios-search-strong"></i>
</a>
</ion-header-bar>
<ion-header-bar ng-class="{active: vm.activeTab == 2}" ng-show="vm.activeTab == 2" >
<a class="button button-clear icon-right ion-ios-arrow-left" ng-click="vm.activeTab = 1" > </a>
<label class="item-input-wrapper tabs-icon-right">
<a href="#" class="button icon-left" style="color: #ffb128;">
<i class="icon ion-ios-search-strong"></i>
</a>
</label>
</ion-header-bar>
第一次写,水平有限!
Edeg_Lin
标签:
原文地址:http://www.cnblogs.com/Lin-Edge/p/4682009.html