Skip to content

Commit

Permalink
Fixed #4780 - TabMenu/Steps: active option for item templating
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 9, 2023
1 parent da0b83e commit fad8a9a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions components/lib/steps/Steps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ export interface StepsSlots {
* Menuitem instance
*/
item: MenuItem;
/**
* Current active state of the menuitem
*/
active: boolean;
/**
* Label property of the menuitem
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/steps/Steps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span :class="cx('label')" v-bind="getPTOptions('label', item, index)">{{ label(item) }}</span>
</span>
</template>
<component v-else :is="$slots.item" :item="item" :index="index" :label="label(item)" :props="getMenuItemProps(item, index)"></component>
<component v-else :is="$slots.item" :item="item" :index="index" :active="index === d_activeStep" :label="label(item)" :props="getMenuItemProps(item, index)"></component>
</li>
</template>
</ol>
Expand Down
8 changes: 8 additions & 0 deletions components/lib/tabmenu/TabMenu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ export interface TabMenuSlots {
* Menuitem instance
*/
item: MenuItem;
/**
* Index of the menuitem
*/
index: number;
/**
* Current active state of the menuitem
*/
active: boolean;
/**
* Label property of the menuitem
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabmenu/TabMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<span :class="cx('label')" v-bind="getPTOptions('label', item, i)">{{ label(item) }}</span>
</a>
</template>
<component v-else :is="$slots.item" :item="item" :index="i" :label="label(item)" :props="getMenuItemProps(item, i)"></component>
<component v-else :is="$slots.item" :item="item" :index="i" :active="i === d_activeIndex" :label="label(item)" :props="getMenuItemProps(item, i)"></component>
</li>
</template>
<li ref="inkbar" role="none" :class="cx('inkbar')" v-bind="ptm('inkbar')"></li>
Expand Down

0 comments on commit fad8a9a

Please sign in to comment.