html:
<ul class="nav-list"> <li ng-class="{‘active‘ : current == 5}" ng-click="setCurrent(5)"><a ui-sref=".goodsManage" >商品管理</a></li> <li ng-class="{‘active‘ : current == 6}" ng-click="setCurrent(6)"><a href="" >仓库签约</a></li> <li ng-class="{‘active‘ : current == 7}" ng-click="setCurrent(7)"><a href="" >客户管理</a></li></ul> js
//点击,样式变换$scope.setCurrent = function(index){ $scope.current = index;} 注: 其中 active 为点击后要添加上的样式
时间: 2024-10-02 08:50:14