<td><button ng-click="add($index)">+</button>{{u.num}}<button ng-click="minus($index)">-</button></td>
//加
$scope.add = function(index){
$scope.user[index].num++;
}
//减
$scope.minus = function(index){
if($scope.user[index].num>1){
$scope.user[index].num--;
}
}
Angular购物车的加减
最新推荐文章于 2018-10-16 09:07:30 发布