2019-03-29 07:00:03 +00:00
|
|
|
<template>
|
|
|
|
<div class="content-section documentation">
|
|
|
|
<TabView>
|
|
|
|
<TabPanel header="Documentation">
|
|
|
|
<h3>Import</h3>
|
|
|
|
<CodeHighlight lang="javascript">
|
|
|
|
import Panel from 'primevue/panel';
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Getting Started</h3>
|
|
|
|
<p>Panel is a container component that accepts content as its children.</p>
|
|
|
|
<CodeHighlight>
|
2019-05-22 16:30:18 +00:00
|
|
|
<Panel header="Godfather I">
|
2019-03-29 07:00:03 +00:00
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
His beloved son Michael 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.
|
|
|
|
</Panel>
|
2019-05-23 08:53:40 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Custom Header</h3>
|
|
|
|
<p>Header of the panel is either defined with the <i>header</i> property or the header template.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<Panel>
|
2019-05-23 11:28:24 +00:00
|
|
|
<template #header>
|
2019-05-23 08:53:40 +00:00
|
|
|
Header Content
|
|
|
|
</template>
|
|
|
|
Content
|
|
|
|
</Panel>
|
2019-03-29 07:00:03 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Toggleable</h3>
|
|
|
|
<p>Content of the panel can be expanded and collapsed using <i>toggleable</i> option.</p>
|
|
|
|
<CodeHighlight>
|
2019-05-22 16:30:18 +00:00
|
|
|
<Panel header="Godfather I" :toggleable="true">
|
2019-03-29 07:00:03 +00:00
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
His beloved son Michael 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.
|
|
|
|
</Panel>
|
2019-05-23 13:11:45 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<Panel header="Header Text" :toggleable="true" :collapsed="true">
|
|
|
|
Content
|
|
|
|
</Panel>
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<p>Use the sync operator to enable two-way binding.</p>
|
|
|
|
|
|
|
|
<CodeHighlight>
|
|
|
|
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
|
|
|
|
<Panel header="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
|
|
|
|
Content
|
|
|
|
</Panel>
|
2020-05-14 08:48:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Custom Icons</h3>
|
|
|
|
<p>Additional icons can be placed at the header section of the panel using the special <i>icons</i> slot. For a unified look, it is suggest to add <i>.p-panel-titlebar-icon</i>
|
|
|
|
class to your icons.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<h3>Advanced</h3>
|
|
|
|
<Panel header="Godfather I">
|
|
|
|
<template #icons>
|
|
|
|
<a tabindex="0" class="p-panel-titlebar-icon" @click="toggle">
|
|
|
|
<span class="pi pi-cog"></span>
|
|
|
|
</a>
|
|
|
|
<Menu id="config_menu" ref="menu" :model="items" :popup="true" />
|
|
|
|
</template>
|
|
|
|
</Panel>
|
2019-03-29 07:00:03 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Properties</h3>
|
2020-01-13 09:04:50 +00:00
|
|
|
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
2019-03-29 07:00:03 +00:00
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Default</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<td>header</td>
|
|
|
|
<td>string</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>Header text of the panel.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>toggleable</td>
|
|
|
|
<td>boolean</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>Defines if content of panel can be expanded and collapsed.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>collapsed</td>
|
|
|
|
<td>boolean</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>Defines the initial state of panel content.</td>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>Events</h3>
|
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Parameters</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<td>toggle</td>
|
|
|
|
<td>event.originalEvent: browser event <br />
|
|
|
|
event.value: collapsed state as a boolean
|
|
|
|
</td>
|
|
|
|
<td>Callback to invoke when a tab toggle.</td>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</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>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Element</th>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-05-23 08:53:40 +00:00
|
|
|
<tr>
|
|
|
|
<td>p-panel</td>
|
|
|
|
<td>Container element.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panel-titlebar</td>
|
|
|
|
<td>Header section.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panel-title</td>
|
|
|
|
<td>Title text of panel.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panel-titlebar-toggler</td>
|
|
|
|
<td>Toggle icon.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-panel-content</td>
|
|
|
|
<td>Content of panel.</td>
|
|
|
|
</tr>
|
2019-03-29 07:00:03 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>Dependencies</h3>
|
|
|
|
<p>None.</p>
|
|
|
|
</TabPanel>
|
|
|
|
|
|
|
|
<TabPanel header="Source">
|
|
|
|
<a href="https://github.com/primefaces/primevue/tree/master/src/views/panel" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
|
|
|
<span>View on GitHub</span>
|
|
|
|
</a>
|
2020-05-14 08:48:25 +00:00
|
|
|
|
2019-03-29 07:00:03 +00:00
|
|
|
<CodeHighlight>
|
|
|
|
<template v-pre>
|
2019-08-04 12:19:34 +00:00
|
|
|
<h3>Regular</h3>
|
|
|
|
<Panel header="Godfather I">
|
2019-12-26 11:24:53 +00:00
|
|
|
<p>The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
2019-08-04 12:19:34 +00:00
|
|
|
His beloved son Michael 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,
|
2019-12-26 11:24:53 +00:00
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.</p>
|
2019-08-04 12:19:34 +00:00
|
|
|
</Panel>
|
2019-03-29 07:00:03 +00:00
|
|
|
|
2020-05-14 08:48:25 +00:00
|
|
|
<h3>Advanced</h3>
|
2019-08-04 12:19:34 +00:00
|
|
|
<Panel header="Godfather I" :toggleable="true">
|
2020-05-14 08:48:25 +00:00
|
|
|
<template #icons>
|
|
|
|
<a tabindex="0" class="p-panel-titlebar-icon" @click="toggle">
|
|
|
|
<span class="pi pi-cog"></span>
|
|
|
|
</a>
|
|
|
|
<Menu id="config_menu" ref="menu" :model="items" :popup="true" />
|
|
|
|
</template>
|
2019-12-26 11:24:53 +00:00
|
|
|
<p>The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
2019-08-04 12:19:34 +00:00
|
|
|
His beloved son Michael 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,
|
2019-12-26 11:24:53 +00:00
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.</p>
|
2019-08-04 12:19:34 +00:00
|
|
|
</Panel>
|
2019-03-29 07:00:03 +00:00
|
|
|
</template>
|
2020-05-14 08:48:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<CodeHighlight lang="js">
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Options',
|
|
|
|
items: [{
|
|
|
|
label: 'Update',
|
|
|
|
icon: 'pi pi-refresh',
|
|
|
|
command: () => {
|
|
|
|
this.$toast.add({severity:'success', summary:'Updated', detail:'Data Updated', life: 3000});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Delete',
|
|
|
|
icon: 'pi pi-times',
|
|
|
|
command: () => {
|
|
|
|
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]},
|
|
|
|
{
|
|
|
|
label: 'Navigate',
|
|
|
|
items: [{
|
|
|
|
label: 'Vue Website',
|
|
|
|
icon: 'pi pi-external-link',
|
|
|
|
url: 'https://vuejs.org/'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Router',
|
|
|
|
icon: 'pi pi-upload',
|
|
|
|
to: '/fileupload'
|
|
|
|
}
|
|
|
|
]}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggle(event) {
|
|
|
|
this.$refs.menu.toggle(event);
|
|
|
|
},
|
|
|
|
save() {
|
|
|
|
this.$toast.add({severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-29 07:00:03 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
</TabPanel>
|
|
|
|
</TabView>
|
|
|
|
</div>
|
|
|
|
</template>
|