我爱编程

angular ,jq多级联动

2017-08-07  本文已影响0人  _喵了个喵_

var arr = [

{

FirstIndex : 1 ,

FirstName : '夏季新品',

SecondList : [

{

secondIndex : 1,

secondName : '商场同款',

thirdList : [

{

thirdIndex : 2,

thirdName : '气质连衣裙'

}

,

{

thirdIndex : 3,

thirdName : '印花衬衫'

}

,

{

thirdIndex : 4,

thirdName : '牛仔单品'

}

,

{

thirdIndex : 5,

thirdName : '百搭休闲裤'

}

,

{

thirdIndex : 6,

thirdName : '无痕文胸'

}

,

{

thirdIndex : 7,

thirdName : '运动文胸'

}

,

{

thirdIndex : 8,

thirdName : '超柔内裤'

}

,

{

thirdIndex : 9,

thirdName : '潮流家居服'

}

,

{

thirdIndex : 10,

thirdName : '  百搭船袜'

}

]

},

{

secondIndex : 2,

secondName : '连衣裙',

thirdList : [

{

thirdIndex : 1,

thirdName : '蕾丝连衣裙'

},

{

thirdIndex : 2,

thirdName : '真丝连衣裙'

}

,

{

thirdIndex : 3,

thirdName : '印花连衣裙'

}

,

{

thirdIndex : 4,

thirdName : '半身裙'

}

,

{

thirdIndex : 5,

thirdName : '蕾丝半身裙'

}

,

{

thirdIndex : 6,

thirdName : '百褶裙'

}

,

{

thirdIndex : 7,

thirdName : '牛仔裙'

}

,

{

thirdIndex : 8,

thirdName : 'a字裙'

}

,

{

thirdIndex : 9,

thirdName : '棉麻连衣裙'

}

,

{

thirdIndex : 10,

thirdName : '包臀裙'

}

,

{

thirdIndex : 11,

thirdName : '长袖连衣裙'

}

]

}

]

}

];

var app = angular.module('myApp',[]);

app.controller('myCtrl',function ($scope)

{

$scope.data = arr;

$scope.init = 8;

$scope.ml = $scope.init;

$scope.pushMore = function (index)

{

this.currentIndex = index;

this.flag = !this.flag;

}

});

上一篇下一篇

猜你喜欢

热点阅读