mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 17:32:36 +00:00
Fixed #4000 - Update context option of pt in AccordionTab
This commit is contained in:
parent
77812ed971
commit
7e8f8a7c7c
2 changed files with 17 additions and 1 deletions
|
@ -95,6 +95,7 @@ export default {
|
||||||
return `${this.id}_${index}_content`;
|
return `${this.id}_${index}_content`;
|
||||||
},
|
},
|
||||||
getTabPT(tab, key, index) {
|
getTabPT(tab, key, index) {
|
||||||
|
const count = this.tabs.length;
|
||||||
const tabMetaData = {
|
const tabMetaData = {
|
||||||
props: tab.props,
|
props: tab.props,
|
||||||
parent: {
|
parent: {
|
||||||
|
@ -102,7 +103,10 @@ export default {
|
||||||
state: this.$data
|
state: this.$data
|
||||||
},
|
},
|
||||||
context: {
|
context: {
|
||||||
index
|
index,
|
||||||
|
count,
|
||||||
|
first: index === 0,
|
||||||
|
last: index === count - 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
12
components/lib/accordiontab/AccordionTab.d.ts
vendored
12
components/lib/accordiontab/AccordionTab.d.ts
vendored
|
@ -123,6 +123,18 @@ export interface AccordionTabContext {
|
||||||
* Current index of the tab.
|
* Current index of the tab.
|
||||||
*/
|
*/
|
||||||
index: number;
|
index: number;
|
||||||
|
/**
|
||||||
|
* Count of tabs
|
||||||
|
*/
|
||||||
|
count: number;
|
||||||
|
/**
|
||||||
|
* Whether the tab is first.
|
||||||
|
*/
|
||||||
|
first: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the tab is last.
|
||||||
|
*/
|
||||||
|
last: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue