OverlayPanel doc added
parent
1b66c2f777
commit
48b09bab5e
|
@ -16,15 +16,15 @@ import DomHandler from '../utils/DomHandler';
|
|||
|
||||
export default {
|
||||
props: {
|
||||
appendTo: String,
|
||||
showCloseIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dismissable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showCloseIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
appendTo: String,
|
||||
baseZIndex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
|
|
@ -14,15 +14,22 @@
|
|||
<img src="/demo/images/nature/nature1.jpg" alt="Nature Image">
|
||||
</OverlayPanel>
|
||||
</div>
|
||||
|
||||
<OverlayPanelDoc/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OverlayPanelDoc from './OverlayPanelDoc';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
toggle(event) {
|
||||
this.$refs.op.toggle(event);
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'OverlayPanelDoc': OverlayPanelDoc
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,183 @@
|
|||
<template>
|
||||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h3>Import</h3>
|
||||
<CodeHighlight lang="javascript">
|
||||
import OverlayPanel from 'primevue/overlaypanel';
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Getting Started</h3>
|
||||
<p>OverlayPanel is accessed via its reference where visibility is controlled using toggle, show and hide methods.</p>
|
||||
<CodeHighlight>
|
||||
<Button type="button" label="Toggle" @click="toggle" />
|
||||
|
||||
<OverlayPanel ref="op">
|
||||
<img src="/demo/images/nature/nature1.jpg" alt="Nature Image">
|
||||
</OverlayPanel>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
toggle(event) {
|
||||
this.$refs.op.toggle(event);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Dismissable and CloseIcon</h3>
|
||||
<p>Clicking outside the overlay hides the panel, setting dismissable to false disables this behavior.
|
||||
Additionally enablign showCloseIcon property displays a close icon at the top right corner to close the panel.</p>
|
||||
<CodeHighlight>
|
||||
<OverlayPanel ref="op" :showCloseIcon="true" :dismissable="true">
|
||||
<img src="/demo/images/nature/nature1.jpg" alt="Nature Image">
|
||||
</OverlayPanel>
|
||||
</CodeHighlight>
|
||||
|
||||
<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>dismissable</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Enables to hide the overlay when outside is clicked.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>showCloseIcon</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>When enabled, displays a close icon at top right corner.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>appendTo</td>
|
||||
<td>string</td>
|
||||
<td>null</td>
|
||||
<td>DOM element instance where the dialog should be mounted.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>baseZIndex</td>
|
||||
<td>number</td>
|
||||
<td>0</td>
|
||||
<td>Base zIndex value to use in layering.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>autoZIndex</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Whether to automatically manage layering.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3>Methods</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>toggle</td>
|
||||
<td>event: Browser event</td>
|
||||
<td>Toggles the visiblity of the overlay.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>show</td>
|
||||
<td>event: Browser event <br />
|
||||
target: Optional target if event.target should not be used</td>
|
||||
<td>Shows the overlay.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hide</td>
|
||||
<td>-</td>
|
||||
<td>Hides the overlay.</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-overlaypanel</td>
|
||||
<td>Container element.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-overlaypanel-content</td>
|
||||
<td>Content of the panel.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-overlaypanel-close</td>
|
||||
<td>Close icon.</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/overlaypanel" 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>OverlayPanel</h1>
|
||||
<p>OverlayPanel is a container component that can overlay other components on page.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-section implementation">
|
||||
<Button type="button" label="Toggle" @click="toggle" />
|
||||
|
||||
<OverlayPanel ref="op" appendTo="body" :showCloseIcon="true">
|
||||
<img src="/demo/images/nature/nature1.jpg" alt="Nature Image">
|
||||
</OverlayPanel>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
export default {
|
||||
methods: {
|
||||
toggle(event) {
|
||||
this.$refs.op.toggle(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue