addon/components/ui-tab-segment.js

  1. import Component from '@ember/component';
  2. import layout from '../templates/components/ui-tab-segment';
  3. import uiSegmentBase from '../mixins/ui-segment-base';
  4.  
  5.  
  6. /**
  7. ui-tab-segment component {{#crossLink "mixins.uiSegmentBase"}}{{/crossLink}}
  8.  
  9. @module components
  10. @namespace components
  11. @class UiTabSegment
  12. @constructor
  13. */
  14. export default Component.extend(uiSegmentBase, {
  15. layout: layout,
  16. _theme: 'tab',
  17. theme: 'bottom attached',
  18. attributeBindings: ['tab:data-tab'],
  19. /**
  20. tab name
  21. @property {String} tab
  22. */
  23. tab: '',
  24. didInsertElement(){
  25. if(this.active){
  26. this.$().addClass('active');
  27. }
  28. }
  29. });