Skip to content

Commit 4b03b4a

Browse files
committed
完善cc-tab
1 parent afff709 commit 4b03b4a

File tree

4 files changed

+74
-76
lines changed

4 files changed

+74
-76
lines changed

.idea/workspace.xml

Lines changed: 66 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</button>
2626
<cc-badge data="badge.data"></cc-badge>
2727
<cc-tabs>
28-
<cc-tab ng-repeat="tab in tabData.tabs" data="tab" active-id="tabData.activeId" ></cc-tab>
28+
<cc-tab ng-repeat="tab in tabData.tabs" data="tab" active-id="tabData.activeId" ng-select="tabData.select"></cc-tab>
2929
</cc-tabs>
3030
</body>
3131
</html>

src/command-component/cmd-cmt.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,19 @@ define([''], function (){
242242
return {
243243
restrict: 'EA',
244244
replace: true,
245-
template: '<li role="presentation" ng-class="{true: '+"'active', false: ''"+'}[data.id === activeId]"><a href="#{{data.href}}" aria-controls="{{data.href}}" role="tab" data-toggle="tab" ng-click="">{{data.label}}</a></li>\n',
245+
template: '<li role="presentation" ng-class="{true: '+"'active', false: ''"+'}[data.id === activeId]">' +
246+
'<a href="#{{data.href}}" aria-controls="{{data.href}}" role="tab" data-toggle="tab" ng-click="ngSelect($event, data)">{{data.label}}</a>' +
247+
'</li>\n',
246248
scope: {
247249
data: '=',
248-
activeId: '=activeId'
250+
activeId: '=activeId',
251+
ngSelect: '=ngSelect'
249252
},
250253
controller: function ($scope) {
251254

252255
},
253256
link: function (scope, element) {
254-
console.log(scope.activeId);
257+
console.log(scope);
255258
}
256259
}
257260
});

src/framework.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ define(['src/command-component/cmd-cmt'], function (cc) {
250250
}
251251
],
252252
select: function (event, tab) {
253-
253+
console.log(tab);
254254
}
255255
}
256256
}]);

0 commit comments

Comments
 (0)