Docs for inplace
parent
176a6816d7
commit
061d3d3c7b
|
@ -21,7 +21,7 @@
|
|||
<h3>Image</h3>
|
||||
<Inplace>
|
||||
<template #display>
|
||||
<span className="pi pi-search" style="vertical-align: middle"></span>
|
||||
<span class="pi pi-search" style="vertical-align: middle"></span>
|
||||
<span style="margin-left:.5em; vertical-align: middle">View Picture</span>
|
||||
</template>
|
||||
<template #content>
|
||||
|
|
|
@ -1,13 +1,248 @@
|
|||
<template>
|
||||
<div>InplaceDoc</div>
|
||||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h3>Import</h3>
|
||||
<CodeHighlight lang="javascript">
|
||||
import Inplace from 'primevue/inplace';
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Getting Started</h3>
|
||||
<p>Inplace requires <i>display</i> and <i>content</i> templates to define the content of each state.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<Inplace>
|
||||
<template #display>
|
||||
<span class="pi pi-search" style="vertical-align: middle"></span>
|
||||
<span style="margin-left:.5em; vertical-align: middle">View Picture</span>
|
||||
</template>
|
||||
<template #content>
|
||||
<img src="demo/images/nature/nature1.jpg" />
|
||||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Closable</h3>
|
||||
<p><i>closable</i> property is handy within forms as it enables to switch back to output mode after editing is completed using a button displayed next to the form field.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<Inplace :closable="true">
|
||||
<template #display>
|
||||
{{text || 'Click to Edit'}}
|
||||
</template>
|
||||
<template #content>
|
||||
<InputText v-model="text" autoFocus />
|
||||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Lazy Data</h3>
|
||||
<p>Inplace allows lazy loading content so that the content gets initialized after getting opened instead of on load. Here is an example that loads, data of a table if the user decides to open the inplace.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<Inplace @open="loadData">
|
||||
<template #display>
|
||||
View Data
|
||||
</template>
|
||||
<template #content>
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
<Column field="brand" header="Brand"></Column>
|
||||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
cars: null
|
||||
}
|
||||
},
|
||||
carService: null,
|
||||
created() {
|
||||
this.carService = new CarService();
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</CodeHighlight>
|
||||
|
||||
<style>
|
||||
<h3>Properties</h3>
|
||||
<p>Any attribute such as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
<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>active</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>Whether the content is displayed or not.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>closable</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>Displays a button to switch back to display mode.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</style>
|
||||
<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>open</td>
|
||||
<td>event: browser event </td>
|
||||
<td>Callback to invoke when inplace is opened.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>close</td>
|
||||
<td>event: browser event </td>
|
||||
<td>Callback to invoke when inplace is closed.</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-inplace</td>
|
||||
<td>Container element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-inplace-display</td>
|
||||
<td>Display container</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-inplace-content</td>
|
||||
<td>Content container</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/panel" 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>Inplace</h1>
|
||||
<p>Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-section implementation">
|
||||
<h3>Input</h3>
|
||||
<Inplace :closable="true">
|
||||
<template #display>
|
||||
{{text || 'Click to Edit'}}
|
||||
</template>
|
||||
<template #content>
|
||||
<InputText v-model="text" autoFocus />
|
||||
</template>
|
||||
</Inplace>
|
||||
|
||||
<h3>Image</h3>
|
||||
<Inplace>
|
||||
<template #display>
|
||||
<span className="pi pi-search" style="vertical-align: middle"></span>
|
||||
<span style="margin-left:.5em; vertical-align: middle">View Picture</span>
|
||||
</template>
|
||||
<template #content>
|
||||
<img src="demo/images/nature/nature1.jpg" />
|
||||
</template>
|
||||
</Inplace>
|
||||
|
||||
<h3>Lazy Data</h3>
|
||||
<Inplace @open="loadData">
|
||||
<template #display>
|
||||
View Data
|
||||
</template>
|
||||
<template #content>
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
<Column field="brand" header="Brand"></Column>
|
||||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</Inplace>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cars: null
|
||||
}
|
||||
},
|
||||
carService: null,
|
||||
created() {
|
||||
this.carService = new CarService();
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue