Accordion doc added
parent
1cc036b10e
commit
6725499fe3
|
@ -104,12 +104,15 @@
|
||||||
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
||||||
</AccordionTab>
|
</AccordionTab>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<AccordionDoc/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AccordionDoc from './AccordionDoc';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -117,6 +120,9 @@ export default {
|
||||||
active2: false,
|
active2: false,
|
||||||
active3: false
|
active3: false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
'AccordionDoc': AccordionDoc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,398 @@
|
||||||
|
<template>
|
||||||
|
<div class="content-section documentation">
|
||||||
|
<TabView>
|
||||||
|
<TabPanel header="Documentation">
|
||||||
|
<h3>Import</h3>
|
||||||
|
<CodeHighlight lang="javascript">
|
||||||
|
import Accordion from 'primevue/accordion';
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Getting Started</h3>
|
||||||
|
<p>Accordion element consists of one or more AccordionTab elements. Title of the tab is defined using header attribute.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionTab header="Header I">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header II">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header III">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Active</h3>
|
||||||
|
<p>Visibility of the content is specified with the active property that supports one or two-way binding.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionTab header="Header I" :active="true">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header II">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header III">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Multiple</h3>
|
||||||
|
<p>By default only one tab at a time can be active, enabling multiple property changes this behavior to allow multiple
|
||||||
|
tabs be active at the same time.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Accordion :multiple="true" >
|
||||||
|
<AccordionTab header="Header I">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header II">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header III">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Disabled</h3>
|
||||||
|
<p>A tab can be disabled by setting the disabled property to true.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionTab header="Header I">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header II">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header III" :disabled="true">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Custom Content at Headers</h3>
|
||||||
|
<p>Custom content can be placed at an accordion header with header element.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-calendar"></i>
|
||||||
|
<span>Header I</span>
|
||||||
|
</template>
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-calendar"></i>
|
||||||
|
<span>Header II</span>
|
||||||
|
</template>
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-calendar"></i>
|
||||||
|
<span>Header III</span>
|
||||||
|
</template>
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Programmatic Control</h3>
|
||||||
|
<p>Tabs can be controlled programmatically using active property.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<div>
|
||||||
|
<Button :icon="active1 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 1st" @click="active1 = !active1" class="p-button-secondary" />
|
||||||
|
<Button :icon="active2 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 2nd" @click="active2 = !active2" class="p-button-secondary" style="margin-left: .5em" />
|
||||||
|
<Button :icon="active3 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 3rd" @click="active3 = !active3" class="p-button-secondary" style="margin-left: .5em" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Accordion :multiple="true">
|
||||||
|
<AccordionTab header="Header I" :active="active1">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header II" :active="active2">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Header III" :active="active3">
|
||||||
|
Content
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<CodeHighlight lang="js">
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
active1: true,
|
||||||
|
active2: false,
|
||||||
|
active3: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Properties For AccordionTab</h3>
|
||||||
|
<div class="doc-tablewrapper">
|
||||||
|
<table class="doc-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Default</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>header</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Orientation of tab headers.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>active</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Visibility of the content.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disabled</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>Whether the tab is disabled.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<div class="doc-tablewrapper">
|
||||||
|
<table class="doc-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Default</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>multiple</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>When enabled, multiple tabs can be activated at the same time.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Events</h3>
|
||||||
|
<div class="doc-tablewrapper">
|
||||||
|
<table class="doc-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Parameters</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>tabOpen</td>
|
||||||
|
<td>event.originalEvent: browser event <br/>
|
||||||
|
event.tab: Opened tab
|
||||||
|
</td>
|
||||||
|
<td>Callback to invoke when a tab gets expanded.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>tabClose</td>
|
||||||
|
<td>event.originalEvent: browser event <br/>
|
||||||
|
event.tab: Closed tab
|
||||||
|
</td>
|
||||||
|
<td>Callback to invoke when an active tab is collapsed by clicking on the header.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Styling</h3>
|
||||||
|
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
|
||||||
|
<div class="doc-tablewrapper">
|
||||||
|
<table class="doc-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Element</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>p-accordion</td>
|
||||||
|
<td>Container element.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>p-accordion-header</td>
|
||||||
|
<td>Header of a tab.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>p-accordion-content</td>
|
||||||
|
<td>Container of a tab.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Dependencies</h3>
|
||||||
|
<p>None.</p>
|
||||||
|
</TabPanel>
|
||||||
|
|
||||||
|
<TabPanel header="Source">
|
||||||
|
<a href="https://github.com/primefaces/primevue/tree/master/src/views/accordion" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||||
|
<span>View on GitHub</span>
|
||||||
|
</a>
|
||||||
|
<CodeHighlight>
|
||||||
|
<template v-pre>
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="content-section introduction">
|
||||||
|
<div class="feature-intro">
|
||||||
|
<h1>AccordionPanel</h1>
|
||||||
|
<p>AccordionPanel groups a collection of contents in tabs.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-section implementation">
|
||||||
|
<h3 class="first">Default</h3>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionTab header="Godfather I">
|
||||||
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war,
|
||||||
|
but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is
|
||||||
|
just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather II">
|
||||||
|
Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, TheGodfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall,
|
||||||
|
deepening The Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills
|
||||||
|
his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather III">
|
||||||
|
The Godfather Part III is set in 1979 and 1980. Michael has moved back to New York and taken great strides to remove the family from crime. He turns over his New York criminal
|
||||||
|
interests to longtime enforcer Joey Zasa. He uses his wealth in an attempt to rehabilitate his reputation through numerous philanthropic acts, administered by a foundation named after his father.
|
||||||
|
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<h3>Multiple</h3>
|
||||||
|
<Accordion :multiple="true">
|
||||||
|
<AccordionTab header="Godfather I">
|
||||||
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war,
|
||||||
|
but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is
|
||||||
|
just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather II">
|
||||||
|
Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, TheGodfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall,
|
||||||
|
deepening The Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills
|
||||||
|
his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather III">
|
||||||
|
The Godfather Part III is set in 1979 and 1980. Michael has moved back to New York and taken great strides to remove the family from crime. He turns over his New York criminal
|
||||||
|
interests to longtime enforcer Joey Zasa. He uses his wealth in an attempt to rehabilitate his reputation through numerous philanthropic acts, administered by a foundation named after his father.
|
||||||
|
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather IV" :disabled="true">
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<h3>Programmatic</h3>
|
||||||
|
<div style="padding: .5em 0">
|
||||||
|
<Button :icon="active1 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 1st" @click="active1 = !active1" class="p-button-secondary" />
|
||||||
|
<Button :icon="active2 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 2nd" @click="active2 = !active2" class="p-button-secondary" style="margin-left: .5em" />
|
||||||
|
<Button :icon="active3 ? 'pi pi-minus' : 'pi pi-plus'" label="Toggle 3rd" @click="active3 = !active3" class="p-button-secondary" style="margin-left: .5em" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Accordion :multiple="true">
|
||||||
|
<AccordionTab header="Godfather I" :active="active1">
|
||||||
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war,
|
||||||
|
but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is
|
||||||
|
just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather II" :active="active2">
|
||||||
|
Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, TheGodfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall,
|
||||||
|
deepening The Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills
|
||||||
|
his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab header="Godfather III" :active="active3">
|
||||||
|
The Godfather Part III is set in 1979 and 1980. Michael has moved back to New York and taken great strides to remove the family from crime. He turns over his New York criminal
|
||||||
|
interests to longtime enforcer Joey Zasa. He uses his wealth in an attempt to rehabilitate his reputation through numerous philanthropic acts, administered by a foundation named after his father.
|
||||||
|
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<h3>Custom Headers</h3>
|
||||||
|
<Accordion class="accordion-custom">
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-calendar"></i>
|
||||||
|
<span>Godfather I</span>
|
||||||
|
</template>
|
||||||
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war,
|
||||||
|
but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is
|
||||||
|
just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-user"></i>
|
||||||
|
<span>Godfather II</span>
|
||||||
|
</template>
|
||||||
|
Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, TheGodfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall,
|
||||||
|
deepening The Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills
|
||||||
|
his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy.
|
||||||
|
</AccordionTab>
|
||||||
|
<AccordionTab>
|
||||||
|
<template slot="header">
|
||||||
|
<i class="pi pi-search"></i>
|
||||||
|
<span>Godfather III</span>
|
||||||
|
<i class="pi pi-cog"></i>
|
||||||
|
</template>
|
||||||
|
The Godfather Part III is set in 1979 and 1980. Michael has moved back to New York and taken great strides to remove the family from crime. He turns over his New York criminal
|
||||||
|
interests to longtime enforcer Joey Zasa. He uses his wealth in an attempt to rehabilitate his reputation through numerous philanthropic acts, administered by a foundation named after his father.
|
||||||
|
A decade earlier, he gave custody of his two children to Kay, who has since remarried.
|
||||||
|
</AccordionTab>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<CodeHighlight lang="javascript">
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
active1: true,
|
||||||
|
active2: false,
|
||||||
|
active3: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<CodeHighlight lang="css">
|
||||||
|
.accordion-custom {
|
||||||
|
i, span {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin: 0 .5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</CodeHighlight>
|
||||||
|
</TabPanel>
|
||||||
|
</TabView>
|
||||||
|
</div>
|
||||||
|
</template>
|
Loading…
Reference in New Issue