Corrected CodeHighlight
parent
a16779a64c
commit
680db0a923
|
@ -1,6 +1,6 @@
|
|||
import Prism from 'prismjs';
|
||||
|
||||
const CodeHighlight2 = {
|
||||
const CodeHighlight = {
|
||||
beforeMount(el, binding) {
|
||||
if (binding.modifiers.script)
|
||||
el.className = 'language-javascript';
|
||||
|
@ -13,4 +13,4 @@ const CodeHighlight2 = {
|
|||
}
|
||||
};
|
||||
|
||||
export default CodeHighlight2;
|
||||
export default CodeHighlight;
|
|
@ -76,9 +76,8 @@ import ToggleButton from './components/togglebutton/ToggleButton';
|
|||
import TriStateCheckbox from './components/tristatecheckbox/TriStateCheckbox';
|
||||
import Galleria from './components/galleria/Galleria';
|
||||
|
||||
import CodeHighlight from './views/codehighlight/CodeHighlight';
|
||||
import AppInputStyleSwitch from './AppInputStyleSwitch';
|
||||
import CodeHighlight2 from './AppCodeHighlight';
|
||||
import CodeHighlight from './AppCodeHighlight';
|
||||
|
||||
import './assets/styles/primevue.css';
|
||||
import 'primeflex/primeflex.css';
|
||||
|
@ -104,7 +103,6 @@ app.use(router);
|
|||
|
||||
app.directive('tooltip', Tooltip);
|
||||
app.directive('ripple', Ripple);
|
||||
app.directive('code', CodeHighlight2);
|
||||
|
||||
app.component('Accordion', Accordion);
|
||||
app.component('AccordionTab', AccordionTab);
|
||||
|
@ -177,7 +175,7 @@ app.component('TreeTable', TreeTable);
|
|||
app.component('TriStateCheckbox', TriStateCheckbox);
|
||||
app.component('Galleria', Galleria);
|
||||
|
||||
app.component('CodeHighlight', CodeHighlight);
|
||||
app.component('AppInputStyleSwitch', AppInputStyleSwitch);
|
||||
app.directive('code', CodeHighlight);
|
||||
|
||||
app.mount('#app');
|
|
@ -390,7 +390,6 @@ export default {
|
|||
</AccordionTab>
|
||||
</Accordion>
|
||||
</template>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import AutoComplete from 'primevue/autocomplete';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>AutoComplete uses v-model for two-way binding, requires a list of suggestions and a complete method to query for the results. The complete method
|
||||
gets the query text as event.query property and should update the suggestions with the search results. Example below connects to a remote datasource to fetch the results;</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<AutoComplete v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountry($event)" field="name" />
|
||||
</CodeHighlight>
|
||||
<CodeHighlight lang="js">
|
||||
|
||||
</code></pre>
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -31,35 +36,42 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Dropdown</h5>
|
||||
<p>Enabling <i>dropdown</i> property displays a button next to the input field where click behavior of the button is defined using
|
||||
dropdownMode property that takes "blank" or "current" as possible values.
|
||||
"blank" is the default mode to send a query with an empty string whereas
|
||||
"current" setting sends a query with the current value of the input.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<AutoComplete v-model="brand" :dropdown="true" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Multiple Mode</h5>
|
||||
<p>Multiple mode is enabled using <i>multiple</i> property to select more than one value from the autocomplete. In this case, value reference should be an array.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountriesMultiple" @complete="searchCountryMultiple($event)" field="name" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Objects</h5>
|
||||
<p>AutoComplete can also work with objects using the <i>field</i> property that defines the label to display
|
||||
as a suggestion. The value passed to the model would still be the object instance of a suggestion.
|
||||
Here is an example with a Country object that has name and code fields such as {name:"United States",code:"USA"}.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<AutoComplete field="label" v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountryBasic($event)" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Templating</h5>
|
||||
<p>Item template allows displaying custom content inside the suggestions panel. The slotProps variable passed to the template provides an item property to represent an item in the suggestions collection.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<AutoComplete v-model="brand" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" :dropdown="true">
|
||||
<template #item="slotProps">
|
||||
<img :alt="slotProps.item" :src="'demo/images/car/' + slotProps.item + '.png'" />
|
||||
|
@ -67,7 +79,7 @@ export default {
|
|||
</template>
|
||||
</AutoComplete>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as name and placeholder are passed to the underlying input element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -246,8 +258,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/autocomplete" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<AutoComplete v-model="selectedCountry1" :suggestions="filteredCountries" @complete="searchCountry($event)" field="name" />
|
||||
|
||||
|
@ -266,9 +278,10 @@ export default {
|
|||
<AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountries" @complete="searchCountry($event)" field="name" />
|
||||
</span>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CountryService from '../../service/CountryService';
|
||||
|
||||
export default {
|
||||
|
@ -303,7 +316,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -7,16 +7,20 @@
|
|||
|
||||
<h5>Numbers</h5>
|
||||
<p>Use <i>.p-badge</i> class to display numbers inside badges.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-badge">2</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Tags</h5>
|
||||
<p>Tags are optimized for text rather than number and used with the <i>.p-tag</i> class. For more rounded styling like pills, add the <i>.p-tag-rounded</i> class</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-tag">New</span>
|
||||
<span class="p-tag p-tag-rounded">New</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Severities</h5>
|
||||
<p>Different options are available as severity levels with.</p>
|
||||
|
@ -31,7 +35,8 @@
|
|||
|
||||
<h5>Positoning</h5>
|
||||
<p>A badge can easily be positioned relative to another element when both are wrapped inside an element with <i>p-overlay-badge</i> class.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-overlay-badge">
|
||||
<i class="pi pi-bell" style="font-size: 2em"></i>
|
||||
<span class="p-badge">2</span>
|
||||
|
@ -41,29 +46,36 @@
|
|||
<Button type="button" label="New" />
|
||||
<span class="p-badge p-badge-warning">5</span>
|
||||
</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Inline Button Badges</h5>
|
||||
<p>Buttons provide integrated badge support with the <i>badge</i> and <i>badgeClass</i> properties.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button type="button" label="Emails" badge="8" />
|
||||
<Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Sizes</h5>
|
||||
<p>Badge sizes are adjusted with additional classes.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-badge">2</span>
|
||||
<span class="p-badge p-badge-l p-badge-sucess">4</span>
|
||||
<span class="p-badge p-badge-xl p-badge-warning">6</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>In addition, when placed inside another element, badge sizes can also derive their size from their parent.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h1>Heading 1 <span class="p-tag p-tag-success">New</span></h1>
|
||||
<h2>Heading 2 <span class="p-tag p-tag-success">New</span></h2>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Styling</h5>
|
||||
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
|
||||
|
@ -112,8 +124,8 @@
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/badge" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Numbers</h3>
|
||||
<div class="badges">
|
||||
<span class="p-badge">2</span>
|
||||
|
@ -163,7 +175,7 @@
|
|||
<span class="p-badge p-badge-xl p-badge-warning">6</span>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,23 +3,28 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import BlockUI from 'primevue/blockui';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>BlockUI is controlled using the <i>blocked</i> property, by default target element to block is the child component. In example below, panel gets blocked
|
||||
with a mask when blockedPanel is enabled and gets unblock when the bound variable is set to false.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<BlockUI :blocked="blockedPanel">
|
||||
<Panel header="Header">
|
||||
Panel Content
|
||||
</Panel>
|
||||
</BlockUI>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -35,14 +40,17 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Full Screen</h5>
|
||||
<p>In full screen mode, instead of a particular element, the whole document gets blocked. Set <i>fullScreen</i> as true in order to enable this functionality.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<BlockUI :blocked="blockedDocument" :fullScreen="true"></BlockUI>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -141,7 +149,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/blockui" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h3>Document</h3>
|
||||
<BlockUI :blocked="blockedDocument" :fullScreen="true"></BlockUI>
|
||||
|
||||
|
@ -159,9 +168,11 @@ export default {
|
|||
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.</p>
|
||||
</Panel>
|
||||
</BlockUI>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -185,7 +196,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,20 +3,25 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Breadcrumb from 'primevue/breadcrumb';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>Breadcrumb uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Breadcrumb requires a collection of menuitems as its model and a home item.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Breadcrumb :home="home" :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -31,7 +36,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -101,13 +107,14 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/menu" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Breadcrumb :home="home" :model="items" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -122,7 +129,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,33 +3,43 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Button from 'primevue/button';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Button is created using the Button element.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Label</h5>
|
||||
<p>Text of the button is defined using the <i>label</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Submit" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<h5>Icons</h5>
|
||||
<p>Icon on a button is specified with <i>icon</i> property and position is configured using <i>iconPos</i> attribute. Default
|
||||
icon position is "left" and alternative is "right". To display only an icon, leave the label as undefined.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Submit" icon="pi pi-check" iconPos="right" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Events</h5>
|
||||
<p>Events are defined with the standard notation.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Submit" @click="handleClick($event)"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Severity</h5>
|
||||
<p>Different options are available as severity levels.</p>
|
||||
|
@ -43,7 +53,8 @@ import Button from 'primevue/button';
|
|||
<li>.p-button-danger</li>
|
||||
</ul>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Primary" />
|
||||
<Button label="Secondary" class="p-button-secondary" />
|
||||
<Button label="Success" class="p-button-success" />
|
||||
|
@ -51,70 +62,87 @@ import Button from 'primevue/button';
|
|||
<Button label="Warning" class="p-button-warning" />
|
||||
<Button label="Warning" class="p-button-help" />
|
||||
<Button label="Danger" class="p-button-danger" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Text Buttons</h5>
|
||||
<p>Text buttons have transparent background and borders, use <i>p-button-text</i> to apply text button styling. In addition when used with <i>.p-button-plain</i>
|
||||
text buttons ignore severity levels and displayed as a regular text.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Submit" class="p-button-text" />
|
||||
<Button icon="pi pi-check" class="p-button-text" />
|
||||
<Button label="Cancel" icon="pi pi-times" class="p-button-text" />
|
||||
<Button label="Search" icon="pi pi-search" iconPos="right" class="p-button-text p-button-text" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Raised and Rounded Buttons</h5>
|
||||
<p>A button can be raised by having "p-button-raised" style class and similarly borders can be made rounded using "p-button-rounded" class.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Primary" class="p-button-raised p-button-rounded" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Outlined Buttons</h5>
|
||||
<p>An alternate styling for a button is the outlined option where background becomes transparent. Apply "p-button-outlined" to style a button as outlined.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Primary" class="p-button-outlined" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Link Buttons</h5>
|
||||
<p>Use "p-button-link" class to render the button as a link.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Link" class="p-button-link" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Badges</h5>
|
||||
<p>Badge is a small status indicator for a button. Refer to the <router-link to="/badge">badge</router-link> documentation for available styling options.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button type="button" label="Emails" badge="8" />
|
||||
<Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-info" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>ButtonSet</h5>
|
||||
<p>Wrapping the buttons in a container having a <i>.p-buttonset</i> class, groups the buttons side to side.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-buttonset">
|
||||
<Button label="Save" icon="pi pi-check" />
|
||||
<Button label="Delete" icon="pi pi-trash" />
|
||||
<Button label="Cancel" icon="pi pi-times" />
|
||||
</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Sizes</h5>
|
||||
<p>2 more sizes are available in addition to a regular button, for a smaller input add <i>p-button-sm</i> and for a larger one, use <i>p-button-lg</i>.
|
||||
Note that these classes available to change the size of a particular button, for global scaling see the <router-link to="/theming">theming</router-link> page.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button label="Small" icon="pi pi-check" class="p-button-sm" />
|
||||
<Button label="Normal" icon="pi pi-check" class="p-button" />
|
||||
<Button label="Large" icon="pi pi-check" class="p-button-lg" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Slot</h5>
|
||||
<p>Custom content can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button>
|
||||
Custom Content
|
||||
</Button>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as style and class are passed to the underlying button element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -206,8 +234,8 @@ import Button from 'primevue/button';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/button" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<Button label="Submit" />
|
||||
<Button label="Disabled" disabled="disabled" />
|
||||
|
@ -320,13 +348,15 @@ import Button from 'primevue/button';
|
|||
<Button label="Large" icon="pi pi-check" class="p-button-lg" />
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
button {
|
||||
margin-right: .5rem;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,18 +3,23 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Calendar from 'primevue/calendar';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Two-way value binding is defined using the standard v-model directive referencing to a Date property.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -22,13 +27,16 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Popup and Inline</h5>
|
||||
<p>Calendar is displayed in a popup by default and <i>inline</i> property needs to be enabled for inline mode.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :inline="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection Mode</h5>
|
||||
<p>By default calendar allows selecting one date only whereas multiple dates can be selected by setting <i>selectionMode</i> to multiple. In this
|
||||
|
@ -36,16 +44,20 @@ export default {
|
|||
Third alternative is the range mode that allows selecting a range based on an array of two values where first value is the start date and second value
|
||||
is the end date.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" selectionMode="single || multiple || range" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>DateFormat</h5>
|
||||
<p>Default date format is mm/dd/yy, to customize this use <i>dateFormat</i> property or define it at locale settings. Note that standalone property overrides the value in locale settings.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" dateFormat="dd.mm.yy" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Following options can be a part of the format.</p>
|
||||
<ul>
|
||||
|
@ -72,43 +84,56 @@ export default {
|
|||
<p>TimePicker is enabled with <i>showTime</i> property and 24 (default) or 12 hour mode is configured using <i>hourFormat</i> option. If you
|
||||
need to use the time picker as standalone, use the <i>timeOnly</i> property.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :showTime="true" />
|
||||
<Calendar v-model="value" :showTime="true" hourFormat="12" />
|
||||
<Calendar v-model="value" :showTime="true" :timeOnly="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Date Restriction</h5>
|
||||
<p>To disable entering dates manually, set <i>manualInput</i> to true and to restrict selectable dates with the <i>minDate</i>
|
||||
and <i>maxDate</i> options.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :minDate="minDateValue" maxDate="maxDateValue" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>To disable specific dates or days, restrict selectable dates use <i>disabledDates</i> and/or <i>disabledDays</i> options.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :disabledDates="invalidDates" :disabledDays="[0,6]" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Button Bar</h5>
|
||||
<p>Button bar displays today and clear buttons and enabled using <i>showButtonBar</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :showButtonBar="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Multiple Months</h5>
|
||||
<p>Displaying multiple months is enabled by setting <i>numberOfMonths</i> property to a value greater than 1.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :numberOfMonths="3" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Localization</h5>
|
||||
<p>Localization for different languages and formats is defined by binding the locale settings object to the <i>locale</i> property. Following is the default values for English.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :locale="en" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -127,24 +152,27 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Calendar UI accepts custom content using header and footer templates.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value">
|
||||
<template #header>Header Content</template>
|
||||
<template #footer>Footer Content</template>
|
||||
</Calendar>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>In addition, cell contents can be templated using a template named "date". This is a handy feature to highlight specific dates. Note that the date property of the slot props
|
||||
passed to the template is not a date instance but a metadata object to represent a Date with "day", "month" and "year" properties. Example below
|
||||
changes the background color of dates between 10th and 15th of each month.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Calendar v-model="value">
|
||||
<template #date="slotProps">
|
||||
<strong v-if="slotProps.date.day > 10 && slotProps.date.day < 15" class="special-day">{{slotProps.date.day}}</strong>
|
||||
|
@ -152,25 +180,31 @@ export default {
|
|||
</template>
|
||||
</Calendar>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.special-day {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Month Picker</h5>
|
||||
<p>Month picker is used to select month and year only without the date, set view mode as "month" to activate month picker.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" view="month" dateFormat="mm/yy" :yearNavigator="true" yearRange="2000:2030" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Touch UI</h5>
|
||||
<p>Touch UI mode displays the calendar overlay at the center of the screen as optimized for touch devices.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Calendar v-model="value" :touchUI="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as name and placeholder are passed to the underlying input element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -543,8 +577,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/calendar" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Popup</h5>
|
||||
<div class=" p-fluid p-grid p-formgrid">
|
||||
<div class="p-field p-col-12 p-md-4">
|
||||
|
@ -617,9 +651,10 @@ export default {
|
|||
<h5>Inline</h5>
|
||||
<Calendar v-model="date14" :inline="true" :showWeek="true" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
created() {
|
||||
let today = new Date();
|
||||
|
@ -675,13 +710,16 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.special-day {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
|
|
|
@ -3,21 +3,26 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Card from 'primevue/card';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Card is used as a container.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Card>
|
||||
Content
|
||||
</Card>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Templates</h5>
|
||||
<p>Card provides <i>header</i>, <i>title</i>, <i>content</i> and <i>footer</i> as the named templates to place content.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Card>
|
||||
<template slot="header">
|
||||
<img alt="user header" src="demo/images/usercard.png">
|
||||
|
@ -34,7 +39,8 @@ import Card from 'primevue/card';
|
|||
<Button icon="pi pi-times" label="Cancel" class="p-button-secondary" style="margin-left: .5em" />
|
||||
</template>
|
||||
</Card>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Styling</h5>
|
||||
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
|
||||
|
@ -79,8 +85,8 @@ import Card from 'primevue/card';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/card" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Card style="width: 25rem; margin-bottom: 2em">
|
||||
<template slot="title">
|
||||
Simple Card
|
||||
|
@ -111,7 +117,7 @@ import Card from 'primevue/card';
|
|||
</template>
|
||||
</Card>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,33 +3,39 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Carousel from 'primevue/carousel';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Carousel requires a collection of items as its value along with a template to render each item.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Carousel :value="cars">
|
||||
<template #item="slotProps">
|
||||
</template>
|
||||
</Carousel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Items per page and Scroll Items</h5>
|
||||
<p>Number of items per page is defined using the <i>numVisible</i> property whereas number of items to scroll is defined with the <i>numScroll</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Carousel :value="cars" :numVisible="3" :numScroll="1">
|
||||
<template #item="slotProps">
|
||||
</template>
|
||||
</Carousel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Responsive</h5>
|
||||
<p>For responsive design, <i>numVisible</i> and <i>numScroll</i> can be defined using the <i>responsiveOptions</i> property that should be an array of
|
||||
objects whose breakpoint defines the max-width to apply the settings.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Carousel :value="cars" :numVisible="4" :numScroll="3" :responsiveOptions="responsiveOptions">
|
||||
<template #header>
|
||||
<h2>Basic</h2>
|
||||
|
@ -55,8 +61,9 @@ import Carousel from 'primevue/carousel';
|
|||
</template>
|
||||
</Carousel>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
responsiveOptions: [
|
||||
|
@ -78,12 +85,14 @@ data() {
|
|||
]
|
||||
}
|
||||
},
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Header and Footer</h5>
|
||||
<p>Custom content projection is available using the <i>header</i> and <i>footer</i> templates.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Carousel :value="cars" :numVisible="3" :numScroll="1" :responsiveOptions="responsiveOptions">
|
||||
<template #header>
|
||||
<h2>Custom Header</h2>
|
||||
|
@ -95,21 +104,25 @@ data() {
|
|||
<h2>Custom Footer</h2>
|
||||
</template>
|
||||
</Carousel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Orientation</h5>
|
||||
<p>Default layout of the Carousel is horizontal, other possible option is the vertical mode that is configured with the <i>orientation</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Carousel :value="cars" :numVisible="1" :numScroll="1" orientation="vertical" verticalViewPortHeight="330px" :responsiveOptions="responsiveOptions">
|
||||
<template #item="slotProps">
|
||||
Content
|
||||
</template>
|
||||
</Carousel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>AutoPlay and Circular</h5>
|
||||
<p>When <i>autoplayInterval</i> is defined in milliseconds, items are scrolled automatically. In addition, for infinite scrolling <i>circular</i> property needs to be enabled. Note that in autoplay mode, circular is enabled by default.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Carousel :value="cars" :numVisible="3" :numScroll="1" :circular="true" :autoplayInterval="3000">
|
||||
<template #header>
|
||||
<h2>Circular, AutoPlay</h2>
|
||||
|
@ -118,7 +131,8 @@ data() {
|
|||
Content
|
||||
</template>
|
||||
</Carousel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -263,8 +277,8 @@ data() {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/carousel" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<Carousel :value="products" :numVisible="3" :numScroll="3" :responsiveOptions="responsiveOptions">
|
||||
<template #header>
|
||||
|
@ -346,9 +360,10 @@ data() {
|
|||
</template>
|
||||
</Carousel>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -382,9 +397,11 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data.slice(0,9));
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.product-item {
|
||||
.product-item-content {
|
||||
border: 1px solid var(--surface-d);
|
||||
|
@ -399,7 +416,8 @@ export default {
|
|||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Vertical</h3>
|
||||
<Chart type="bar" :data="basicData" />
|
||||
|
||||
|
@ -16,9 +16,10 @@
|
|||
<h3>Stacked</h3>
|
||||
<Chart type="bar" :data="stackedData" :options="stackedOptions"/>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -161,7 +162,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -5,25 +5,32 @@
|
|||
|
||||
<h5>Getting Started</h5>
|
||||
<p>To begin with, charts.js package needs to be installed in your project.</p>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
npm install chart.js --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Chart from 'primevue/chart';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Chart Types</h5>
|
||||
<p>Chart type is defined using the <i>type</i> property. Currently there are 6 options available; <b>pie</b>, <b>doughtnut</b>, <b>line</b>, <b>bar</b>, <b>radar</b> and <b>polarArea</b>.</p>
|
||||
|
||||
<h5>Data</h5>
|
||||
<p>Data of a chart is provided using a binding to the <i>data</i> property, each type has its own format of data. Here is an example of a line chart. For more information refer to the <a href="https://www.chartjs.org/">charts.js</a> documentation.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Chart type="bar" :data="basicData" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -45,16 +52,20 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Options</h5>
|
||||
<p>While a series can be customized per dataset, general chart options are defined with options property.
|
||||
Example below adds a title and customizes the legend position of the chart. For all available options refer to the <a href="https://www.chartjs.org/">charts.js</a> documentation.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Chart type="line" :data="data" :options="options" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
options: {
|
||||
responsive: true,
|
||||
hoverMode: 'index',
|
||||
|
@ -77,7 +88,8 @@ options: {
|
|||
}]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following is the additional property to configure the component.</p>
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chart type="bar" :data="chartData" :options="chartOptions"/>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -75,7 +76,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chart type="doughnut" :data="chartData" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -33,7 +34,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic</h3>
|
||||
<Chart type="line" :data="basicData" />
|
||||
|
||||
|
@ -13,9 +13,10 @@
|
|||
<h3>Line Styles</h3>
|
||||
<Chart type="line" :data="lineStylesData" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -108,7 +109,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chart type="pie" :data="chartData" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -33,7 +34,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chart type="polarArea" :data="chartData" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -41,7 +42,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chart type="radar" :data="chartData" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -40,7 +41,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,26 +3,33 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Checkbox from 'primevue/checkbox';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Checkbox can either be used in multiple selection with other checkboxes or as a single checkbox to provide a boolean value.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Checkbox v-model="checked" :binary="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Multiple Values</h5>
|
||||
<p>Multiple mode is enabled by default, v-model property refers to an array to bind the selected values.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Checkbox name="city" value="Chicago" v-model="cities" />
|
||||
<Checkbox name="city" value="Los Angeles" v-model="cities" />
|
||||
<Checkbox name="city" value="New York" v-model="cities" />
|
||||
<Checkbox name="city" value="San Francisco" v-model="cities" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -30,7 +37,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>As v-model is two-way binding enabled, prepopulating the model array with values is enough to display the related
|
||||
checkboxes as checked by default.</p>
|
||||
|
@ -108,8 +116,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic</h3>
|
||||
<div class="p-field-checkbox">
|
||||
<Checkbox id="binary" v-model="checked" :binary="true" />
|
||||
|
@ -140,9 +148,10 @@ export default {
|
|||
<label :for="category.key">{{category.name}}</label>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -156,7 +165,8 @@ export default {
|
|||
this.selectedCategories = this.categories.slice(1,3);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,20 +3,24 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Chips from 'primevue/chips';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>An array as the value can be bound using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Chips v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>A chip is customized using the <i>chip</i> template where the chip value is passed to the slotProps with the value property.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Chips v-model="value">
|
||||
<template #chip="slotProps">
|
||||
<div>
|
||||
|
@ -26,7 +30,7 @@ import Chips from 'primevue/chips';
|
|||
</template>
|
||||
</Chips>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as name and placeholder are passed to the underlying input element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -146,8 +150,8 @@ import Chips from 'primevue/chips';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/chips" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<Chips v-model="value1" />
|
||||
|
||||
|
@ -164,9 +168,10 @@ import Chips from 'primevue/chips';
|
|||
</template>
|
||||
</Chips>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -176,7 +181,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<template>
|
||||
<pre :class="languageClass" ref="code"><code><slot></slot>
|
||||
</code></pre>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Prism from 'prismjs';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
lang: {
|
||||
type: String,
|
||||
default: 'markup'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
languageClass() {
|
||||
return 'language-' + this.lang;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
Prism.highlightElement(this.$el.children[0]);
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ColorPicker from 'primevue/colorpicker';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>A model can be bound using the standard v-model directive. Default color format to use in value binding is "hex" and other possible values are "rgb" and "hsb".</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<ColorPicker v-model="color" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -21,13 +26,16 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Inline and Overlay</h5>
|
||||
<p>ColorPicker is displayed as an overlay with a preview option by default where second alternative is the inline mode.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<ColorPicker v-model="color" :inline="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -163,17 +171,18 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Inline</h3>
|
||||
<ColorPicker v-model="color1" :inline="true" />
|
||||
|
||||
<h3>Overlay</h3>
|
||||
<ColorPicker v-model="color2" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -182,7 +191,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ContextMenu from 'primevue/contextmenu';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>ContextMenu uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
|
@ -13,7 +15,8 @@ import ContextMenu from 'primevue/contextmenu';
|
|||
<h5>Getting Started</h5>
|
||||
<p>ContextMenu requires a collection of menuitems as its model.</p>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -151,23 +154,29 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Document Menu</h5>
|
||||
<p>Setting global property attaches the context menu to the document.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<ContextMenu :global="true" :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Element Menu</h5>
|
||||
<p>ContextMenu is attached to a custom element manually using the reference and calling the <i>show(event)</i> method.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<img alt="logo" src="demo/images/nature/nature3.jpg" @contextmenu="onImageRightClick">
|
||||
<ContextMenu ref="menu" :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -180,7 +189,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -306,14 +316,15 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/contextmenu" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<img alt="logo" src="demo/images/nature/nature3.jpg" @contextmenu="onImageRightClick" aria-haspopup="true">
|
||||
<ContextMenu ref="menu" :model="items" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -456,7 +467,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products">
|
||||
<Column field="code" header="Code"></Column>
|
||||
<Column field="name" header="Name"></Column>
|
||||
|
@ -30,9 +30,10 @@
|
|||
<Column field="quantity" header="Quantity"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -49,7 +50,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -61,8 +61,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="sales">
|
||||
<ColumnGroup type="header">
|
||||
<Row>
|
||||
|
@ -110,9 +110,10 @@
|
|||
</ColumnGroup>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -157,7 +158,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Fit Mode</h3>
|
||||
<DataTable :value="products" :resizableColumns="true" columnResizeMode="fit">
|
||||
<Column field="code" header="Code"></Column>
|
||||
|
@ -51,9 +51,10 @@
|
|||
<Column field="quantity" header="Quantity"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -70,7 +71,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products">
|
||||
<template #header>
|
||||
<div style="text-align:left">
|
||||
|
@ -38,9 +38,10 @@
|
|||
<Column v-for="(col, index) of selectedColumns" :field="col.field" :header="col.header" :key="col.field + '_' + index"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -71,7 +72,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" contextMenu v-model:contextMenuSelection="selectedProduct" @row-contextmenu="onRowContextMenu">
|
||||
<Column field="code" header="Code"></Column>
|
||||
<Column field="name" header="Name"></Column>
|
||||
|
@ -42,9 +42,10 @@
|
|||
|
||||
<ContextMenu :model="menuModel" ref="cm" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -82,7 +83,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Toolbar class="p-mb-4">
|
||||
<template slot="left">
|
||||
<Button label="New" icon="pi pi-plus" class="p-button-success p-mr-2" @click="openNew" />
|
||||
|
@ -277,9 +277,10 @@
|
|||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -381,7 +382,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,20 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import DataTable from 'primevue/datatable';
|
||||
import Column from 'primevue/column';
|
||||
import ColumnGroup from 'primevue/columngroup'; //optional for column grouping
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>DataTable requires a value as an array of objects and columns defined with Column component. Throughout the samples, a car interface having vin, brand, year and color properties is used to define an object to be displayed by the datatable.
|
||||
Cars are loaded by a CarService that connects to a server to fetch the cars with a axios. Note that this is only for demo purposes, DataTable does not have any restrictions on how the data is provided.</p>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import axios from 'axios'
|
||||
|
||||
export default class CarService {
|
||||
|
@ -30,10 +33,12 @@ export default class CarService {
|
|||
return axios.get('demo/data/cars-large.json').then(res => res.data.data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Example response;</p>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
{
|
||||
"data": [
|
||||
{"brand": "Volkswagen", "year": 2012, "color": "Orange", "vin": "dsad231ff"},
|
||||
|
@ -48,11 +53,12 @@ export default class CarService {
|
|||
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s"}
|
||||
]
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Following sample datatable has 4 columns and retrieves the data from a service on mount.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -60,9 +66,10 @@ export default class CarService {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -79,19 +86,21 @@ export default {
|
|||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Dynamic Columns</h5>
|
||||
<p>Column components can be dynamically generated using a v-for as well.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -116,7 +125,8 @@ export default {
|
|||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Column Component Properties utilized by the DataTable</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -305,8 +315,8 @@ export default {
|
|||
<p>Field data of a corresponding row is displayed as the cell content by default, this can be customized using a <i>body</i> template where current row data and column properties are passed via the slot props.
|
||||
On the other hand, <i>header</i> and <i>footer</i> sections of a column can either be defined with the properties or the templates. Similarly DataTable itself also provides header and footer properties along with the templates for the main header and footer of the table.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars">
|
||||
<template #header>
|
||||
<div>
|
||||
|
@ -336,14 +346,14 @@ export default {
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Sizes</h5>
|
||||
<p>In addition to the regular table, a smal and a large version are available with different paddings. For a table
|
||||
with smaller paddings use <i>p-datatable-sm</i> class and for a larger one use <i>p-datatable-lg</i>.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" class="p-datatable-sm">
|
||||
<template #header>
|
||||
Small Table
|
||||
|
@ -374,12 +384,12 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Column Grouping</h5>
|
||||
<p>Columns can be grouped at header and footer sections by defining a ColumnGroup with nested rows and columns.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="sales">
|
||||
<ColumnGroup type="header">
|
||||
<Row>
|
||||
|
@ -411,15 +421,15 @@ export default {
|
|||
</ColumnGroup>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Pagination</h5>
|
||||
<p>Pagination is enabled by setting <i>paginator</i> property to true and defining the <i>rows</i> property defines the number of rows per page.
|
||||
See the <router-link to="/paginator">Paginator</router-link> for the available customization options such as paginator templates, page links,
|
||||
rows per page options and more which can be passed through the DataTable.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :paginator="true" :rows="10">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -427,11 +437,11 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>paginatorLeft and paginatorLeft templates are available to specify custom content at the left and right side.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :paginator="true" :rows="10">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -445,13 +455,13 @@ export default {
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>Paginator can also be programmed programmatically using a binding to the <i>first</i> property that defines the index of the
|
||||
first element to display. For example setting first to zero will reset the paginator to the very first page. This property
|
||||
also supports "sync" keyword in case you'd like your binding to be updated whenever the user changes the page.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :paginator="true" :rows="10" :first="firstRecordIndex">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -459,14 +469,14 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Sorting</h5>
|
||||
<p>Enabling <i>sortable</i> property at column component would be enough to make a column sortable.
|
||||
The property to use when sorting is the <i>field</i> by default and can be customized using the <i>sortField</i>.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin" :sortable="true"></Column>
|
||||
<Column field="year" header="Year" :sortable="true"></Column>
|
||||
|
@ -474,11 +484,11 @@ export default {
|
|||
<Column field="color" header="Color" :sortable="true"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>By default sorting is executed on the clicked column only. To enable multiple field sorting, set <i>sortMode</i> property to "multiple" and use metakey when clicking on another column.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" sortMode="multiple">
|
||||
<Column field="vin" header="Vin" :sortable="true"></Column>
|
||||
<Column field="year" header="Year" :sortable="true"></Column>
|
||||
|
@ -486,12 +496,12 @@ export default {
|
|||
<Column field="color" header="Color" :sortable="true"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>In case you'd like to display the table as sorted per a single column by default on mount or programmatically apply sort, use <i>sortField</i> and <i>sortOrder</i> properties. These
|
||||
two properties also support the "sync" keyword to get updated when the user applies sort a column.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" sortField="year" :sortOrder="1">
|
||||
<Column field="vin" header="Vin" :sortable="true"></Column>
|
||||
<Column field="year" header="Year" :sortable="true"></Column>
|
||||
|
@ -506,11 +516,11 @@ export default {
|
|||
<Column field="color" header="Color" :sortable="true"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>In multiple mode, use the <i>multiSortMeta</i> property and bind an array of SortMeta objects instead.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" sortMode="multiple" :multiSortMeta="multiSortMeta">
|
||||
<Column field="vin" header="Vin" :sortable="true"></Column>
|
||||
<Column field="year" header="Year" :sortable="true"></Column>
|
||||
|
@ -518,9 +528,10 @@ export default {
|
|||
<Column field="color" header="Color" :sortable="true"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
multiSortMeta: [
|
||||
|
@ -529,7 +540,8 @@ data() {
|
|||
]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Filtering</h5>
|
||||
<p>Filtering is enabled by defining a filter template per column to populate the <i>filters</i> property of the DataTable. The <i>filters</i>
|
||||
|
@ -537,8 +549,8 @@ data() {
|
|||
via the slotProps and accepts any form element as the filter element. Default match mode is "startsWith" and this can be configured per column using the <i>filterMatchMode</i> property that also accepts
|
||||
"contains", "endsWith", "equals", "notEquals", "in", "lt", "lte", "gt", "gte" and "custom" as available modes.</p>
|
||||
<p>Optionally a global filter is available to search against all the fields, in this case the special <i>global</i> keyword should be the property to be populated.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :filters="filters" :paginator="true" :rows="10">
|
||||
<template #header>
|
||||
<div style="text-align: right">
|
||||
|
@ -575,20 +587,21 @@ data() {
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>Custom filtering is implemented by setting the filterMatchMode to "custom" and defining a filter function.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Column field="vin" header="Vin" filterMatchMode="myOwnEquals">
|
||||
<template #filter>
|
||||
<InputText type="text" v-model="filters['vin']" class="p-column-filter" />
|
||||
</template>
|
||||
</Column>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
methods: {
|
||||
myOwnEquals(value, filter) {
|
||||
if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {
|
||||
|
@ -602,7 +615,8 @@ methods: {
|
|||
return value.toString().toLowerCase() === filter.toString().toLowerCase();
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection</h5>
|
||||
<p>DataTable provides single and multiple selection modes on click of a row. Selected rows are bound to the <i>selection</i> property and updated using the sync keyword.
|
||||
|
@ -613,8 +627,8 @@ methods: {
|
|||
|
||||
<p>In single mode, selection binding is an object reference.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :selection.sync="selectedCar" selectionMode="single" dataKey="vin">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -622,11 +636,11 @@ methods: {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>In multiple mode, selection binding should be an array and multiple items can either be selected using metaKey or toggled individually depending on the value of <i>metaKeySelection</i> property value which is true by default. On touch enabled devices metaKeySelection is turned off automatically. Additionally ShiftKey is supported for range selection.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :selection.sync="selectedCars" selectionMode="multiple" dataKey="vin">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -634,11 +648,11 @@ methods: {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>If you prefer a radioButton or a checkbox instead of a row click, use the <i>selectionMode</i> of a column instead. Following datatable displays a checkbox at the first column of each row and automatically adds a header checkbox to toggle selection of all rows.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :selection.sync="selectedCars" selectionMode="multiple" dataKey="vin">
|
||||
<Column selectionMode="multiple"></Column>
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -647,12 +661,12 @@ methods: {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Scrolling</h5>
|
||||
<p>DataTable supports both horizontal and vertical scrolling as well as frozen columns and rows. Scrollable DataTable is enabled using <i>scrollable</i> property and <i>scrollHeight</i> to define the viewport height.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="200px">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -660,12 +674,12 @@ methods: {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Flex Scroll</h5>
|
||||
<p>In cases where viewport should adjust itself according to the table parent's height instead of a fixed viewport height, set scrollHeight option as flex. In example below, table is inside a Dialog where viewport size dynamically responds to the dialog size changes such as maximizing.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Button label="Show" icon="pi pi-external-link" @click="openDialog" />
|
||||
<Dialog header="Flex Scroll" :visible.sync="dialogVisible" :style="{width: '50vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}">
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="flex">
|
||||
|
@ -680,12 +694,12 @@ methods: {
|
|||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Full Page Scroll</h5>
|
||||
<p>FlexScroll can also be used for cases where scrollable viewport should be responsive with respect to the window size. See the Full Page demo for an example.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div style="height: calc(100vh - 143px)">
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="flex">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -695,12 +709,12 @@ methods: {
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Horizontal Scrolling</h5>
|
||||
<p>In horizontal scrolling, it is required to give fixed widths to columns. In general when customizing the column widths of scrollable tables, use colgroup as below to avoid misalignment issues as it will apply both the header, body and footer sections which are different separate elements internally.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="200px" style="width: 600px">
|
||||
<Column field="vin" header="Vin" headerStyle="width: 250px" columnKey="vin_1"></Column>
|
||||
<Column field="year" header="Year" headerStyle="width: 250px" columnKey="year_1"></Column>
|
||||
|
@ -712,12 +726,12 @@ methods: {
|
|||
<Column field="color" header="Color" headerStyle="width: 250px" columnKey="color_2"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Frozen Rows and Columns</h5>
|
||||
<p>Certain columns can be frozen by using the <i>frozen</i> property of the column component. Widths of the frozen section is specified by the <i>frozenWidth</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="200px" frozenWidth="300px" :loading="loading">
|
||||
<Column field="vin" header="Vin" headerStyle="width: 300px" columnKey="vin_1" :frozen="true">
|
||||
<template #body="slotProps">
|
||||
|
@ -735,11 +749,11 @@ methods: {
|
|||
<Column field="color" header="Color" headerStyle="width: 300px" columnKey="color_3"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>Note that frozen columns are enabled, frozen and scrollable cells may have content with varying height which leads to misalignment. Provide fixed height to cells to avoid alignment issues.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :scrollable="true" scrollHeight="200px" frozenWidth="300px" :loading="loading">
|
||||
<Column field="vin" header="Vin" headerStyle="width: 300px" bodyStyle="height: 25px" columnKey="vin" :frozen="true">
|
||||
<template #body="slotProps">
|
||||
|
@ -751,11 +765,11 @@ methods: {
|
|||
<Column field="color" header="Color" headerStyle="width: 300px" bodyStyle="height: 25px" columnKey="color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>One or more rows can be displayed as fixed using the <i>frozenValue</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :frozenValue="frozenCars" :scrollable="true" scrollHeight="200px" :loading="loading">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -763,7 +777,7 @@ methods: {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>When using frozen columns with column grouping, use <i>frozenheadergroup</i> and <i>frozenfootergroup</i> types to define grouping for the frozen section.</p>
|
||||
|
||||
|
@ -772,8 +786,8 @@ methods: {
|
|||
For smooth scrolling twice the amount of rows property is loaded on a lazy load event. In addition, to avoid performance problems row height is not calculated automatically and
|
||||
should be provided using <i>virtualRowHeight</i> property which defaults to 28px. View the <router-link to="/datatable/scroll">scrolling demo</router-link> for a sample in-memory implementation.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="lazyCars" :scrollable="true" scrollHeight="200px" :lazy="true" :rows="20"
|
||||
:virtualScroll="true" :virtualRowHeight="30" @virtual-scroll="onVirtualScroll" :totalRecords="lazyTotalRecords">
|
||||
<Column field="vin" header="Vin">
|
||||
|
@ -798,9 +812,10 @@ methods: {
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -828,7 +843,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Lazy Loading</h5>
|
||||
<p>Lazy mode is handy to deal with large datasets, instead of loading the entire data, small chunks of data is loaded by invoking corresponding callbacks such as paging and sorting. Sample belows imitates lazy paging by using an in memory list.
|
||||
|
@ -841,8 +857,8 @@ export default {
|
|||
in lazy filtering, totalRecords should also be updated to align the data with the paginator.</p>
|
||||
|
||||
<p>Here is a sample paging implementation with in memory data, a more enhanced example with a backend is being worked on and will be available at a github repository.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :lazy="true" :paginator="true" :rows="10"
|
||||
:totalRecords="totalRecords" :loading="loading" @page="onPage($event)">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -851,9 +867,10 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -892,14 +909,15 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Row Expansion</h5>
|
||||
<p>Rows can be expanded to display additional content using the <i>expandedRows</i> property with the sync operator accompanied by a template named "expansion". <i>row-expand</i> and <i>row-collapse</i> are optional callbacks that are invoked when a row is expanded or toggled.</p>
|
||||
|
||||
<p>The <i>dataKey</i> property identifies a unique value of a row in the dataset, it is not mandatory in row expansion functionality however being able to define it increases the performance of the table signifantly.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :expandedRows.sync="expandedRows" dataKey="vin"
|
||||
@row-expand="onRowExpand" @row-collapse="onRowCollapse">
|
||||
<template #header>
|
||||
|
@ -929,9 +947,10 @@ export default {
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -965,7 +984,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>InCell Editing</h5>
|
||||
<p>In cell editing provides a rapid and user friendly way to manipulate the data. The datatable provides a flexible API
|
||||
|
@ -975,8 +995,8 @@ export default {
|
|||
<p>Individuals cell editing is configured by setting the <i>editMode</i> to "cell" and defining editors with the "editor" template. The content of the
|
||||
editor defines how the editing is implemented, below example demonstrates two cases. In the first example, simple v-model editors are utilized. This is pretty straightforward in most cases.
|
||||
On the other hand, second example is more advanced to consider validations and ability to revert values with the escape key.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic Cell Editing</h3>
|
||||
<p>Simple editors with v-model.</p>
|
||||
<DataTable :value="cars1" editMode="cell">
|
||||
|
@ -1019,9 +1039,10 @@ export default {
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
import Vue from 'vue';
|
||||
|
||||
|
@ -1104,12 +1125,13 @@ export default {
|
|||
this.carService.getCarsSmall().then(data => this.cars2 = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Row Editing is defined by setting <i>cellEdit</i> as "row", defining <i>editingRows</i> with the sync operator to hold the reference to the editing rows and adding a row editor column to provide the editing controls. Note that
|
||||
since <i>editingRows</i> is two-way binding enabled, you may use it to initially display one or more rows in editing more or programmatically toggle row editing.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Row Editing</h3>
|
||||
<DataTable :value="cars" editMode="row" dataKey="vin" :editingRows.sync="editingRows"
|
||||
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
|
||||
|
@ -1132,9 +1154,10 @@ export default {
|
|||
<Column :rowEditor="true" headerStyle="width:7rem" bodyStyle="text-align:center"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
import Vue from 'vue';
|
||||
|
||||
|
@ -1164,13 +1187,14 @@ export default {
|
|||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Column Resize</h5>
|
||||
<p>Columns can be resized using drag drop by setting the <i>resizableColumns</i> to true. There are two resize modes; "fit" and "expand". Fit is the default one and the overall table width does not change when a column is resized.
|
||||
In "expand" mode, table width also changes along with the column width. <i>column-resize-end</i> is a callback that passes the resized column header and delta change as a parameter.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :resizableColumns="true" columnResizeMode="fit | expand">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -1178,11 +1202,11 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<p>It is important to note that when you need to change column widths, since table width is 100%, giving fixed pixel widths does not work well as browsers scale them, instead give percentage widths.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :resizableColumns="true" columnResizeMode="fit | expand">
|
||||
<Column field="vin" header="Vin" headerStyle="width: 20%"></Column>
|
||||
<Column field="year" header="Year" headerStyle="width: 40%"></Column>
|
||||
|
@ -1190,13 +1214,13 @@ export default {
|
|||
<Column field="color" header="Color" headerStyle="width: 20%"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Column Reorder</h5>
|
||||
<p>Columns can be reordered using drag drop by setting the <i>reorderableColumns</i> to true. <i>column-reorder</i> is a callback that is invoked when a column is reordered. DataTable keeps the column order state internally using keys that identifies a column using the field property. If the column has no field, use columnKey instead as
|
||||
it is mandatory for columns to have unique keys when reordering is enabled.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :reorderableColumns="true">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -1204,12 +1228,12 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Row Reorder</h5>
|
||||
<p>Data can be reordered using drag drop by adding a reorder column that will display an icon as a drag handle along with the <i>row-order</i> event which is <b>mandatory</b> to update the new order. Note that the reorder icon can be customized using <i>rowReorderIcon</i> of the column component.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" @row-reorder="onRowReorder">
|
||||
<Column :rowReorder="true" headerStyle="width: 3em" />
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -1218,9 +1242,10 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1243,7 +1268,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Row Group</h5>
|
||||
<p>Row Grouping comes in two modes, in "subheader" mode rows are grouped by a header row along with an optional group footer. In addition, the groups can be made
|
||||
|
@ -1252,8 +1278,8 @@ export default {
|
|||
|
||||
<p>Example below demonstrates the all grouping alternatives. Note that data needs to be sorted for grouping which can also be done by the table itself by speficying the sort properties.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Subheader Grouping</h3>
|
||||
<DataTable :value="cars" rowGroupMode="subheader" groupRowsBy="brand"
|
||||
sortMode="single" sortField="brand" :sortOrder="1">
|
||||
|
@ -1305,9 +1331,10 @@ export default {
|
|||
<Column field="price" header="Price"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1346,12 +1373,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Data Export</h5>
|
||||
<p>DataTable can export its data in CSV format using <i>exportCSV()</i> method.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" ref="dt">
|
||||
<template #header>
|
||||
<div style="text-align: left">
|
||||
|
@ -1364,9 +1392,10 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1388,15 +1417,16 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>TableState</h5>
|
||||
<p>Stateful table allows keeping the state such as page, sort and filtering either at local storage or session storage so that when the page is visited again, table would render the data using its last settings.
|
||||
Enabling state is easy as defining a unique <i>stateKey</i>, the storage to keep the state is defined with the <i>stateStorage</i> property that accepts session for sessionStorage and local for localStorage.
|
||||
Currently following features are supported by TableState; paging, sorting, filtering, column resizing, column reordering, row expansion, row group expansion and row selection.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :paginator="true" :rows="10" :filters.sync="filters"
|
||||
stateStorage="session" stateKey="dt-state-demo-session"
|
||||
:selection.sync="selectedCar" selectionMode="single" dataKey="vin">
|
||||
|
@ -1438,9 +1468,10 @@ export default {
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1481,12 +1512,13 @@ export default {
|
|||
this.carService.getCarsMedium().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>ContextMenu</h5>
|
||||
<p>DataTable provides exclusive integration with the ContextMenu component using, <i>contextMenu</i>, <i>contextMenuSelection</i> property along with the <i>row-contextmenu</i> event.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" contextMenu :contextMenuSelection.sync="selectedCar" @row-contextmenu="onRowContextMenu">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year"></Column>
|
||||
|
@ -1496,9 +1528,10 @@ export default {
|
|||
|
||||
<ContextMenu :model="menuModel" ref="cm" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1533,12 +1566,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Empty Message</h5>
|
||||
<p>When there is no data, you may use the <i>empty</i> template to display a message.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars">
|
||||
<template #empty>
|
||||
No records found
|
||||
|
@ -1549,13 +1583,13 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Loading</h5>
|
||||
<p>A loading status indicator can be displayed when the <i>loading</i> property is enabled. The icon is customized through <i>loadingIcon</i> property. Additionally
|
||||
an option loading template is available to render as the body until the data is loaded.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :loading="loading">
|
||||
<template #loading>
|
||||
Loading records, please wait...
|
||||
|
@ -1566,9 +1600,10 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1592,12 +1627,13 @@ export default {
|
|||
});
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Responsive</h5>
|
||||
<p>DataTable display can be optimized according to screen sizes, this example demonstrates a sample demo where columns are stacked on small screens.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" class="p-datatable-responsive-demo">
|
||||
<template #header>
|
||||
Responsive
|
||||
|
@ -1628,9 +1664,10 @@ export default {
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1647,9 +1684,11 @@ export default {
|
|||
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.p-datatable-responsive-demo .p-datatable-tbody > tr > td .p-column-title {
|
||||
display: none;
|
||||
}
|
||||
|
@ -1681,13 +1720,14 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Row and Cell Styling</h5>
|
||||
<p>Certain rows or cells can easily be styled based on conditions. Cell styling is implemented with templating whereas row styling utilizes the <i>rowClass</i> property which takes the
|
||||
row data as a parameter and returns the style class as a string.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="cars" :rowClass="rowClass">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
<Column field="year" header="Year" bodyStyle="padding: 0">
|
||||
|
@ -1701,9 +1741,10 @@ export default {
|
|||
<Column field="color" header="Color"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -1726,9 +1767,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.year-cell {
|
||||
padding: 0.429em 0.857rem;
|
||||
|
||||
|
@ -1743,7 +1786,8 @@ export default {
|
|||
background-color: #344b5f !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -2396,7 +2440,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/datatabledemo" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
|
@ -2416,10 +2461,11 @@ export default {
|
|||
}
|
||||
},
|
||||
/...
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
</code></pre>
|
||||
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="customers" :paginator="true" class="p-datatable-customers" :rows="10"
|
||||
dataKey="id" :rowHover="true" :selection.sync="selectedCustomers" :filters="filters" :loading="loading"
|
||||
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" :rowsPerPageOptions="[10,25,50]"
|
||||
|
@ -2514,9 +2560,10 @@ export default {
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -2580,9 +2627,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
::v-deep(.p-paginator) {
|
||||
.p-paginator-current {
|
||||
margin-left: auto;
|
||||
|
@ -2676,7 +2725,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -18,15 +18,16 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products">
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -51,7 +52,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -95,8 +95,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic Cell Editing</h5>
|
||||
<p>Simple editors with v-model.</p>
|
||||
<DataTable :value="products1" editMode="cell" class="editable-cells-table">
|
||||
|
@ -176,9 +176,10 @@
|
|||
<Column :rowEditor="true" headerStyle="width:7rem" bodyStyle="text-align:center"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -277,19 +278,22 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products3 = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
::v-deep(.editable-cells-table td.p-cell-editing) {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<script>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" ref="dt">
|
||||
<template #header>
|
||||
<div style="text-align: left">
|
||||
|
@ -40,9 +40,10 @@
|
|||
<Column field="quantity" header="Quantity"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -64,7 +65,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -100,8 +100,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="customers" :paginator="true" class="p-datatable-customers" :rows="10"
|
||||
dataKey="id" :filters="filters" :loading="loading">
|
||||
<template #header>
|
||||
|
@ -188,9 +188,10 @@
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -251,7 +252,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" class="p-datatable-gridlines">
|
||||
<template #header>
|
||||
Header
|
||||
|
@ -42,9 +42,10 @@
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -61,7 +62,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="customers" :lazy="true" :paginator="true" :rows="10"
|
||||
:totalRecords="totalRecords" :loading="loading" @page="onPage($event)">
|
||||
<Column field="name" header="Name"></Column>
|
||||
|
@ -35,9 +35,10 @@
|
|||
<Column field="representative.name" header="Representative"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -76,7 +77,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="customers" :paginator="true" :rows="10"
|
||||
paginatorTemplate="CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
|
||||
:rowsPerPageOptions="[10,20,50]"
|
||||
|
@ -48,9 +48,10 @@
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -67,7 +68,8 @@ export default {
|
|||
this.customerService.getCustomersLarge().then(data => this.customers = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -19,16 +19,17 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" :reorderableColumns="true" @column-reorder="onColReorder" @row-reorder="onRowReorder">
|
||||
<Column :rowReorder="true" headerStyle="width: 3rem" :reorderableColumn="false" />
|
||||
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -62,7 +63,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" class="p-datatable-responsive-demo" :paginator="true" :rows="10">
|
||||
<template #header>
|
||||
Responsive
|
||||
|
@ -76,9 +76,10 @@
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -95,9 +96,11 @@ export default {
|
|||
this.productService.getProducts().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.p-datatable-responsive-demo .p-datatable-tbody > tr > td .p-column-title {
|
||||
display: none;
|
||||
}
|
||||
|
@ -133,7 +136,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" :expandedRows.sync="expandedRows" dataKey="id"
|
||||
@row-expand="onRowExpand" @row-collapse="onRowCollapse">
|
||||
<template #header>
|
||||
|
@ -132,9 +132,10 @@
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -171,7 +172,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -108,8 +108,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Subheader Grouping</h5>
|
||||
<p>Group customers by their representative.</p>
|
||||
|
@ -206,9 +206,10 @@
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -247,7 +248,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -111,8 +111,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Vertical</h5>
|
||||
<DataTable :value="customers" :scrollable="true" scrollHeight="200px" :loading="loading">
|
||||
|
@ -212,9 +212,10 @@
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
|
||||
export default {
|
||||
|
@ -308,7 +309,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -84,8 +84,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Single</h5>
|
||||
<p>In single mode, a row is selected on click event of a row. If the row is already selected then the row gets unselected.</p>
|
||||
|
@ -158,9 +158,10 @@
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -191,7 +192,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" class="p-datatable-sm">
|
||||
<template #header>
|
||||
Small Table
|
||||
|
@ -80,9 +80,10 @@
|
|||
<Column field="quantity" header="Quantity"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -99,7 +100,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Single Column</h5>
|
||||
<DataTable :value="products">
|
||||
|
@ -136,9 +136,10 @@
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -160,7 +161,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Session Storage</h5>
|
||||
<DataTable :value="customers" :paginator="true" :rows="10" :filters.sync="filters1"
|
||||
|
@ -250,9 +250,10 @@
|
|||
</DataTable>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CustomerService from '../../service/CustomerService';
|
||||
import DataTableDoc from './DataTableDoc';
|
||||
|
||||
|
@ -289,7 +290,8 @@ export default {
|
|||
this.customerService.getCustomersMedium().then(data => this.customers = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" class="p-datatable-striped">
|
||||
<Column field="code" header="Code"></Column>
|
||||
<Column field="name" header="Name"></Column>
|
||||
|
@ -30,9 +30,10 @@
|
|||
<Column field="quantity" header="Quantity"></Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -49,7 +50,8 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products" :rowClass="rowClass">
|
||||
<Column field="code" header="Code"></Column>
|
||||
<Column field="name" header="Name"></Column>
|
||||
|
@ -42,9 +42,10 @@
|
|||
</Column>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -75,9 +76,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.outofstock {
|
||||
font-weight: 700;
|
||||
color: #FF5252;
|
||||
|
@ -97,7 +100,8 @@ export default {
|
|||
::v-deep(.row-accessories) {
|
||||
background-color: rgba(0,0,0,.15) !important;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataTable :value="products">
|
||||
<template #header>
|
||||
<div class="table-header">
|
||||
|
@ -84,9 +84,10 @@
|
|||
</template>
|
||||
</DataTable>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -108,9 +109,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.table-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -121,7 +124,8 @@ export default {
|
|||
width: 100px;
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import DataView from 'primevue/dataview';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>PrimeFlex</h5>
|
||||
<p>DataView utilizes PrimeFlex library so it needs to be installed before getting started. Refer to <router-link to="/flexgrid">FlexGrid</router-link> documentation for details.</p>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>DataView requires a collection of items as its value and one or more templates depending on the layout mode e.g. list and grid. Throughout the samples, a car interface having vin, brand, year and color properties are used to define an object to be displayed by the dataview. Cars are loaded by a CarService that connects to a server to fetch the cars.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<template v-pre>
|
||||
<pre v-code.script>
|
||||
<code><template v-pre>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -29,14 +31,14 @@ export default {
|
|||
}
|
||||
}
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Layouts</h5>
|
||||
<p>DataView has two layout modes; <i>list</i> and <i>grid</i> where a separate template is used to render an item in each mode. In list mode name of the template is "list" whereas
|
||||
in grid mode it is "grid".</p>
|
||||
<p>Note that there is no restriction to use both layouts at the same time, you may configure only one layout using the layout property with the corresponding template.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<template #list="slotProps">
|
||||
<div class="p-col-12">
|
||||
<div class="car-details">
|
||||
|
@ -63,20 +65,24 @@ export default {
|
|||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Sections</h5>
|
||||
<p>Header and Footer are the two templates that are capable of displaying custom content.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<template #header>Header Content</template>
|
||||
<template #footer>Footer Content</template>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Empty Message</h5>
|
||||
<p>Where there is no data to display, the optional <i>empty</i> template can be used to display information.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<template #empty>No records found.</template>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>DataViewLayoutOptions</h5>
|
||||
<p>When both layout modes are enabled in DataView, a UI element would be necessary to let the user toggle between the view. DataViewLayoutOptions is a helper component
|
||||
|
@ -84,8 +90,8 @@ export default {
|
|||
you can create your own that updates the layout property of the DataView.
|
||||
</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataView :value="cars" :layout="layout">
|
||||
<template #header>
|
||||
<DataViewLayoutOptions v-model="layout"></DataViewLayoutOptions>
|
||||
|
@ -98,13 +104,13 @@ export default {
|
|||
</template>
|
||||
</DataView>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Paginator</h5>
|
||||
<p>Pagination is enabled by setting paginator property to true, rows attribute defines the number of rows per page and pageLinks specify the the number
|
||||
of page links to display. To customize the left and right side of the paginators, use <i>paginatorLeft</i> and <i>paginatorRight</i> templates.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataView :value="cars" :layout="layout" paginatorPosition="both" :paginator="true" :rows="20">
|
||||
<template #paginatorLeft>
|
||||
<Button type="button" icon="pi pi-refresh"/>
|
||||
|
@ -120,13 +126,13 @@ export default {
|
|||
</template>
|
||||
</DataView>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Sorting</h5>
|
||||
<p><i>sortField</i> and <i>sortOrder</i> properties are available for the sorting functionality, for flexibility there is no built-in UI available so that a custom UI can be used for the sorting element.
|
||||
Here is an example that uses a dropdown where simply updating the sortField-sortOrder bindings of the DataView initiates sorting.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataView :value="cars" :layout="layout" :sortOrder="sortOrder" :sortField="sortField">
|
||||
<template #header>
|
||||
<div class="p-grid p-nogutter">
|
||||
|
@ -146,10 +152,10 @@ export default {
|
|||
</template>
|
||||
</DataView>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<template v-pre>
|
||||
<pre v-code.script>
|
||||
<code><template v-pre>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -191,14 +197,14 @@ export default {
|
|||
}
|
||||
}
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Lazy Loading</h5>
|
||||
<p>Lazy loading is useful to deal with huge datasets, in order to implement lazy loading use the pagination and utilize the <i>page</i> callback to load your data from the backend.
|
||||
Pagination in this case needs to display the logical number of records bound to the <i>totalRecords</i> property so that paginator can display itself according to the total records although you'd only
|
||||
need to load the data of the current page.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataView :value="cars" :layout="layout" :paginator="true" :rows="20" :lazy="true" @page="onPage($event)">
|
||||
<template #list="slotProps" >
|
||||
<div>Vin: <b>{{slotProps.data.vin}}</b></div>
|
||||
|
@ -208,10 +214,10 @@ export default {
|
|||
</template>
|
||||
</DataView>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<template v-pre>
|
||||
<pre v-code.script>
|
||||
<code><template v-pre>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -230,7 +236,7 @@ export default {
|
|||
}
|
||||
}
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -413,8 +419,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/showcase/dataview" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DataView :value="products" :layout="layout" :paginator="true" :rows="9" :sortOrder="sortOrder" :sortField="sortField">
|
||||
<template #header>
|
||||
<div class="p-grid p-nogutter">
|
||||
|
@ -471,9 +477,10 @@ export default {
|
|||
</template>
|
||||
</DataView>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -515,7 +522,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,14 +3,16 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import DeferredContent from 'primevue/deferredcontent';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>DeferredContent is used as a wrapper element of its content..</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DeferredContent>
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -20,12 +22,12 @@ import DeferredContent from 'primevue/deferredcontent';
|
|||
</DataTable>
|
||||
</DeferredContent>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Load Event</h5>
|
||||
<p>onLoad callback is useful to initialize the content when it becomes visible on scroll such as loading data.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<DeferredContent @load="onDataLoad">
|
||||
<DataTable :value="cars">
|
||||
<Column field="vin" header="Vin"></Column>
|
||||
|
@ -35,7 +37,7 @@ import DeferredContent from 'primevue/deferredcontent';
|
|||
</DataTable>
|
||||
</DeferredContent>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Component has no properties.</p>
|
||||
|
@ -71,8 +73,8 @@ import DeferredContent from 'primevue/deferredcontent';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/deferredcontent" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div style="height: 800px">
|
||||
Scroll down to lazy load an image and the DataTable which initiates a query that is not executed on initial page load to speed up load performance.
|
||||
</div>
|
||||
|
@ -93,9 +95,10 @@ import DeferredContent from 'primevue/deferredcontent';
|
|||
</DataTable>
|
||||
</DeferredContent>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -118,7 +121,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Dialog from 'primevue/dialog';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Dialog is used as a container and visibility is managed with <i>visible</i> property that requires the v-model for two-way binding.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog header="Header" v-model:visible="display" >
|
||||
Content
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -23,17 +28,21 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Header and Footer</h5>
|
||||
<p>Header and Footer sections are defined using properties with the same name that accept simple strings or with the <i>header</i> and <i>footer</i> templates for custom content.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog header="Header" footer="Footer" v-model:visible="display">
|
||||
Content
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog v-model:visible="display">
|
||||
<template #header>
|
||||
<h3>Header</h3>
|
||||
|
@ -46,27 +55,33 @@ export default {
|
|||
<Button label="Yes" icon="pi pi-check" autofocus />
|
||||
</template>
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Positioning</h5>
|
||||
<p>Dialog location is controlled with the <i>position</i> property whose default value is center. Other valid values are top", "bottom", "left", "right", "topleft", "topright", "bottomleft" and "bottomright".</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog position="top" v-model:visible="display">
|
||||
Content
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Popup Content inside the Dialog</h5>
|
||||
<p>If the dialog contains components with popup elements such as Dropdown or Calendar, set <i>contentStyle</i> to overflow:visible so that overlays can be displayed outside of the content area.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog v-model:visible="display" :contentStyle="{overflow: 'visible'}">
|
||||
Content
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Initial Focus</h5>
|
||||
<p>Adding <i>autofocus</i> to an element in the dialog makes it the initial focus target when dialog gets shown.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dialog v-model:visible="display">
|
||||
Content
|
||||
<template #footer>
|
||||
|
@ -74,7 +89,8 @@ export default {
|
|||
<Button label="Yes" autofocus/>
|
||||
</template>
|
||||
</Dialog>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -254,8 +270,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/dialog" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<Button label="Show" icon="pi pi-external-link" @click="openBasic" />
|
||||
<Dialog header="Header" v-model:visible="displayBasic" :style="{width: '50vw'}">
|
||||
|
@ -356,9 +372,10 @@ export default {
|
|||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -414,9 +431,11 @@ export default {
|
|||
'DialogDoc': DialogDoc
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.p-button {
|
||||
margin: 0 .5rem 0 0;
|
||||
min-width: 10rem;
|
||||
|
@ -435,7 +454,8 @@ p {
|
|||
.p-dialog .p-button {
|
||||
min-width: 6rem;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
</ul>
|
||||
|
||||
<h5>Examples</h5>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-inline">Displayed as inline.</div>
|
||||
<div class="p-d-flex">Displayed as a flexbox container.</div>
|
||||
<div class="p-d-block p-d-lg-inline">Inline for larger screens and block for others.</div>
|
||||
|
@ -35,7 +36,8 @@
|
|||
<div class="p-d-none p-d-md-inline-flex">Hidden on a Small Screen</div>
|
||||
<div class="p-d-none p-print-block">Only visible when printed.</div>
|
||||
<div class="p-d-block p-print-none">Not available for printing.</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Customization</h5>
|
||||
<p>A custom build with different values can be obtained from <a href="https://github.com/primefaces/primeflex">PrimeFlex</a> using the _variables.scss file.</p>
|
||||
|
@ -45,8 +47,8 @@
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/display" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Inline</h5>
|
||||
<InputText class="p-mr-2 p-d-inline" />
|
||||
|
@ -71,7 +73,7 @@
|
|||
<p class="p-d-block p-print-none">Not available for printing.</p>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Dropdown from 'primevue/dropdown';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Dropdown requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the label property of the option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dropdown v-model="selectedCity" :options="cities" optionLabel="name" placeholder="Select a City" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
selectedCity: null,
|
||||
|
@ -26,7 +31,8 @@ data() {
|
|||
]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Placeholder</h5>
|
||||
<p>Common pattern is providing an empty option as the placeholder when using native selects, however Dropdown has built-in support using the placeholder option so it is suggested to use it instead of creating an empty option.</p>
|
||||
|
@ -34,15 +40,17 @@ data() {
|
|||
<h5>Filtering</h5>
|
||||
<p>Options can be filtered using an input field in the overlay by enabling the <i>filter</i> property.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" placeholder="Select a Car" :filter="true" filterPlaceholder="Find Car"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>option</i> template that gets the option instance as a parameter.</p>
|
||||
<p>In addition the <i>value</i> template can be used to customize the selected value.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" :filter="true" placeholder="Select a Car" :showClear="true">
|
||||
<template #value="slotProps">
|
||||
<div class="p-dropdown-car-value" v-if="slotProps.value">
|
||||
|
@ -61,7 +69,7 @@ data() {
|
|||
</template>
|
||||
</Dropdown>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -334,8 +342,8 @@ data() {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/dropdown" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<Dropdown v-model="selectedCity1" :options="cities" optionLabel="name" placeholder="Select a City" />
|
||||
|
||||
|
@ -361,9 +369,10 @@ data() {
|
|||
</template>
|
||||
</Dropdown>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -392,7 +401,8 @@ export default {
|
|||
}
|
||||
},
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Editor from 'primevue/editor';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>A model can be bound using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Editor v-model="value" editorStyle="height: 320px"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Toolbar</h5>
|
||||
<p>Editor provides a default toolbar with common options, to customize it define your elements inside the header element. Refer to <a href="http://quilljs.com/docs/modules/toolbar/">Quill documentation</a> for available controls.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Editor v-model="value" editorStyle="height: 320px">
|
||||
<template slot="toolbar">
|
||||
<span class="ql-formats">
|
||||
|
@ -25,7 +30,8 @@ import Editor from 'primevue/editor';
|
|||
</span>
|
||||
</template>
|
||||
</Editor>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -133,17 +139,19 @@ import Editor from 'primevue/editor';
|
|||
<h5>Dependencies</h5>
|
||||
<p><a href="http://quilljs.com">Quill</a> Editor 1.3+.</p>
|
||||
<p>Resources of quill needs to be added to your application.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
npm install quill --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
|
||||
<TabPanel header="Source">
|
||||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Default</h3>
|
||||
<Editor v-model="value1" editorStyle="height: 320px"/>
|
||||
|
||||
|
@ -158,9 +166,10 @@ npm install quill --save
|
|||
</template>
|
||||
</Editor>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -169,7 +178,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -4,24 +4,28 @@
|
|||
<TabPanel header="Documentation">
|
||||
<h5>Getting Started</h5>
|
||||
<p>Elevation is added to an element using the <i>.p-shadow-{level}</i> class.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-shadow-1" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Levels</h5>
|
||||
<p>There are 24 depths available varying from 1 to 24.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-shadow-1" />
|
||||
<div class="p-shadow-24" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
|
||||
<TabPanel header="Source">
|
||||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/elevation" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="p-grid">
|
||||
<div class="p-col" v-for="index in 24" :key="index">
|
||||
<div :class="['box', 'p-shadow-' + index]">
|
||||
|
@ -30,7 +34,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,58 +3,70 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Fieldset from 'primevue/fieldset';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Fieldset is a container component that accepts content as its children.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Fieldset legend="Godfather I">
|
||||
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.
|
||||
</Fieldset>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Header</h5>
|
||||
<p>Header of the panel is either defined with the <i>legend</i> property or the legend template.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Fieldset>
|
||||
<template #legend>
|
||||
Header Content
|
||||
</template>
|
||||
Content
|
||||
</Fieldset>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
|
||||
<h5>Toggleable</h5>
|
||||
<p>Content of the fieldset can be expanded and collapsed using <i>toggleable</i> option..</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Fieldset legend="Godfather I" :toggleable="true">
|
||||
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.
|
||||
</Fieldset>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Fieldset legend="Header Text" :toggleable="true" :collapsed="true">
|
||||
Content
|
||||
</Fieldset>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Use the sync operator to enable two-way binding.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
|
||||
<Fieldset legend="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
|
||||
Content
|
||||
</Fieldset>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -152,8 +164,8 @@ import Fieldset from 'primevue/fieldset';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/fieldset" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Regular</h5>
|
||||
<Fieldset legend="Header">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
|
@ -170,9 +182,10 @@ import Fieldset from 'primevue/fieldset';
|
|||
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</Fieldset>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -182,7 +195,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,48 +3,62 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import FileUpload from 'primevue/fileupload';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>FileUpload requires a <i>url</i> property as the upload target and a <i>name</i> to identify the files at backend.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload name="demo[]" url="./upload" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Multiple Uploads</h5>
|
||||
<p>Only one file can be selected at a time by default, to allow selecting multiple files at once enable <i>multiple</i> option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload name="demo[]" url="./upload" :multiple="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Basic UI</h5>
|
||||
<p>FileUpload basic mode provides a simpler UI as an alternative to advanced mode.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload mode="basic" name="demo[]" url="./upload" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>DragDrop</h5>
|
||||
<p>File selection can also be done by dragging and dropping from the filesystem to the content section of the component.</p>
|
||||
|
||||
<h5>Auto Uploads</h5>
|
||||
<p>When <i>auto</i> property is enabled, upload begins as soon as file selection is completed or a file is dropped on the drop area.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload mode="basic" name="demo[]" url="./upload" :auto="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>File Types</h5>
|
||||
<p>Selectable file types can be restricted with <i>accept</i> property, example below only allows images to be uploaded. Read more about other possible values <a href="https://www.w3schools.com/tags/att_input_accept.asp"> here</a>.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload mode="basic" name="demo[]" url="./upload" accept="image/*" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>File Size and File Linit</h5>
|
||||
<p>Maximium file size can be restricted using <i>maxFileSize</i> property defined in bytes. Similarly <i>fileLimit</i> is available to restrict the number of files to be uploaded.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload name="demo[]" url="./upload" :maxFileSize="1000000" :fileLimit="3" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>In order to customize the default messages use <i>invalidFileSizeMessage</i> and <i>invalidFileLimitMessage</i> options where {0} placeholder refers to the filename and {1} the file size.</p>
|
||||
<ul>
|
||||
|
@ -61,25 +75,31 @@ import FileUpload from 'primevue/fileupload';
|
|||
|
||||
<h5>Custom Upload</h5>
|
||||
<p>Uploading implementation can be overridden by enabling <i>customMode</i> property and defining a custom upload handler event.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload name="demo[]" :customUpload="true" @uploader="myUploader" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
myUploader(event) {
|
||||
//event.files == files to upload
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Empty Template</h5>
|
||||
<p>When there is no file selected, you may use the empty slot to display content.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FileUpload name="demo[]" url="./upload" />
|
||||
<template #empty>
|
||||
<p>Drag and drop files to here to upload.</p>
|
||||
</template>
|
||||
</FileUpload>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -297,8 +317,8 @@ myUploader(event) {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/fileupload" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Advanced</h3>
|
||||
<FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000">
|
||||
<template #empty>
|
||||
|
@ -312,9 +332,10 @@ myUploader(event) {
|
|||
<h3>Basic with Auto</h3>
|
||||
<FileUpload mode="basic" name="demo[]" url="./upload.php" accept="image/*" :maxFileSize="1000000" @upload="onUpload" :auto="true" chooseLabel="Browse" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
methods: {
|
||||
onUpload() {
|
||||
|
@ -322,7 +343,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
<h5>Flex Container</h5>
|
||||
<p>An element can configured as a flexbox container using the <i>p-d-flex</i> or <i>p-d-inline-flex</i> classes.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex">Flex Container</div>
|
||||
<div class="p-d-inline-flex">Inline Flex Container</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="box p-d-flex p-mb-3">Flex Container</div>
|
||||
<div class="box p-d-inline-flex">Inline Flex Container</div>
|
||||
|
@ -26,13 +28,15 @@
|
|||
</ul>
|
||||
|
||||
<h6>Row</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2">Item 1</div>
|
||||
<div class="p-mr-2">Item 2</div>
|
||||
<div>Item 3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2">Item 1</div>
|
||||
<div class="p-mr-2">Item 2</div>
|
||||
|
@ -40,13 +44,15 @@
|
|||
</div>
|
||||
|
||||
<h6>Column</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-flex-column">
|
||||
<div class="p-mb-2">Item 1</div>
|
||||
<div class="p-mb-2">Item 2</div>
|
||||
<div>Item 3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-flex-column">
|
||||
<div class="p-mb-2">Item 1</div>
|
||||
<div class="p-mb-2">Item 2</div>
|
||||
|
@ -56,13 +62,15 @@
|
|||
<h6>Responsive</h6>
|
||||
<p>Row direction for larger screens and column for smaller.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-flex-column p-flex-md-row">
|
||||
<div class="p-mb-2 p-mr-2">Item 1</div>
|
||||
<div class="p-mb-2 p-mr-2">Item 2</div>
|
||||
<div class="p-mb-2 p-mr-2">Item 3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-d-flex p-flex-column p-flex-md-row">
|
||||
<div class="p-mb-2 p-mr-2">Item 1</div>
|
||||
|
@ -98,13 +106,15 @@
|
|||
<p>Order configures the way in which they appear in the flex container. <i>p-order-{value}</i> format is used where value can be a number from 0 to 6.</p>
|
||||
|
||||
<h6>Customized</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-order-3">Item 1</div>
|
||||
<div class="p-mr-2 p-order-1">Item 2</div>
|
||||
<div class="p-mr-2 p-order-2">Item 3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-order-3">Item 1</div>
|
||||
<div class="p-mr-2 p-order-1">Item 2</div>
|
||||
|
@ -113,13 +123,15 @@
|
|||
|
||||
<h6>Responsive</h6>
|
||||
<p>Orders change depending on the screen size.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-order-3 p-order-md-2">Item 1</div>
|
||||
<div class="p-mr-2 p-order-1 p-order-md-3">Item 2</div>
|
||||
<div class="p-mr-2 p-order-2 p-order-md-1">Item 3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-order-3 p-order-md-2">Item 1</div>
|
||||
|
@ -177,7 +189,8 @@
|
|||
</ul>
|
||||
|
||||
<h6>No Wrap</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -186,7 +199,8 @@
|
|||
<div class="p-mr-2 p-mb-2">Item 5</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 6</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -197,7 +211,8 @@
|
|||
</div>
|
||||
|
||||
<h6>Wrap</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-flex-wrap">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -206,7 +221,8 @@
|
|||
<div class="p-mr-2 p-mb-2">Item 5</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 6</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-flex-wrap">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -217,7 +233,8 @@
|
|||
</div>
|
||||
|
||||
<h6>Wrap Reverse</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-flex-wrap-reverse">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -226,7 +243,8 @@
|
|||
<div class="p-mr-2 p-mb-2">Item 5</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 6</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-flex-wrap-reverse">
|
||||
<div class="p-mr-2 p-mb-2">Item 1</div>
|
||||
<div class="p-mr-2 p-mb-2">Item 2</div>
|
||||
|
@ -268,24 +286,28 @@
|
|||
</ul>
|
||||
|
||||
<h6>Between</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-jc-between">
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-jc-between">
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
</div>
|
||||
|
||||
<h6>Center</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-jc-center">
|
||||
<div class="p-mr-2">Item 1</div>
|
||||
<div>Item 2</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-jc-center">
|
||||
<div class="p-mr-2">Item 1</div>
|
||||
<div>Item 2</div>
|
||||
|
@ -337,24 +359,28 @@
|
|||
</ul>
|
||||
|
||||
<h6>Start</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-ai-start">
|
||||
<div class="p-mr-2" style="height:100px">Item 1</div>
|
||||
<div style="height:50px">Item 2</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-ai-start">
|
||||
<div class="p-mr-2" style="height:100px">Item 1</div>
|
||||
<div style="height:50px">Item 2</div>
|
||||
</div>
|
||||
|
||||
<h6>Center</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-ai-center">
|
||||
<div class="p-mr-2" style="height:100px">Item 1</div>
|
||||
<div style="height:50px">Item 2</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-ai-center">
|
||||
<div class="p-mr-2" style="height:100px">Item 1</div>
|
||||
<div style="height:50px">Item 2</div>
|
||||
|
@ -400,14 +426,16 @@
|
|||
<li>stretch (default)</li>
|
||||
</ul>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex" style="height: 150px;">
|
||||
<div class="p-mr-2 p-as-start">Start</div>
|
||||
<div class="p-mr-2 p-as-center">Center</div>
|
||||
<div class="p-mr-2 p-as-end">End</div>
|
||||
<div class="p-mr-2 p-as-stretch">Stretch</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex" style="height: 150px;">
|
||||
<div class="p-mr-2 p-as-start">Start</div>
|
||||
<div class="p-mr-2 p-as-center">Center</div>
|
||||
|
@ -494,13 +522,15 @@
|
|||
<p>When combined with <router-link to="/setup">spacing utilities</router-link>, flexbox offers endless possibilities.</p>
|
||||
<h6>Horizontal Spacing</h6>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-p-3 card">
|
||||
<Button type="Button" icon="pi pi-check" class="p-mr-2" />
|
||||
<Button type="Button" icon="pi pi-trash" class="p-button-danger"/>
|
||||
<Button type="Button" icon="pi pi-search" class="p-ml-auto p-button-help"/>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-p-3 card">
|
||||
<Button type="Button" icon="pi pi-check" class="p-mr-2" />
|
||||
<Button type="Button" icon="pi pi-trash" class="p-button-danger"/>
|
||||
|
@ -508,12 +538,14 @@
|
|||
</div>
|
||||
|
||||
<h6>Vertical Spacing</h6>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-d-flex p-flex-column" style="height:150px">
|
||||
<div>Item 1</div>
|
||||
<div class="p-mt-auto">Item 2</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<div class="p-d-flex p-flex-column" style="height:150px">
|
||||
<div>Item 1</div>
|
||||
<div class="p-mt-auto">Item 2</div>
|
||||
|
|
|
@ -83,8 +83,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="p-fluid p-grid">
|
||||
<div class="p-field p-col-12 p-md-4">
|
||||
<span class="p-float-label">
|
||||
|
@ -153,9 +153,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CountryService from '../../service/CountryService';
|
||||
|
||||
export default {
|
||||
|
@ -204,7 +205,8 @@ export default {
|
|||
}
|
||||
},
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -4,16 +4,19 @@
|
|||
<TabPanel header="Documentation">
|
||||
<h5>Getting Started</h5>
|
||||
<p>Core member of the FormLayout is the <i>.p-field</i> class that wraps the input field and the associated label.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-field">
|
||||
<label for="fieldId">Label</label>
|
||||
<InputText id="fieldId" type="text" />
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Vertical Layout</h5>
|
||||
<p>In its simplest form, a vertical layout is created when used within <i>.p-fluid</i> that makes the components use all available width.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-fluid">
|
||||
<div class="p-field">
|
||||
<label for="firstname">Firstname</label>
|
||||
|
@ -24,12 +27,14 @@
|
|||
<InputText id="lastname" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Vertical Layout with Grid</h5>
|
||||
<p>This is where FormLayout actually hooks-in to PrimeFlex with the help of <i>.p-formgrid</i> class to optimize the content for form design. Example
|
||||
below arranges two fields to be displayed next two each other.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-fluid p-formgrid p-grid">
|
||||
<div class="p-field p-col">
|
||||
<label for="firstname">Firstname</label>
|
||||
|
@ -40,13 +45,15 @@
|
|||
<InputText id="lastname" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Horizontal and Fixed Width</h5>
|
||||
<p>In horizontal form, label of the field is displayed on the same row of the input as opposed to the vertical alternative. In this
|
||||
example, label has a fixed width where container of the inputs gets the remaining space.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-field p-grid">
|
||||
<label for="firstname" class="p-col-fixed" style="width:100px">Firstname</label>
|
||||
<div class="p-col">
|
||||
|
@ -59,11 +66,13 @@
|
|||
<InputText id="lastname" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Horizontal and Fluid</h5>
|
||||
<p>Wrapping the form in the previous example with <i>.p-fluid</i> and removing the fixed width results in a fluid layout.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-fluid">
|
||||
<div class="p-field p-grid">
|
||||
<label for="firstname" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0">Firstname</label>
|
||||
|
@ -78,12 +87,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Inline</h5>
|
||||
<p>Inline forms are used to display the content on the same row and can simply be implemented by adding <i>.p-formgroup-inline</i> to the form container. Note that per design requirements, if labels
|
||||
are not visually hidden, it is suggested to use <i>.p-sr-only</i> to still support screen readers.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-formgroup-inline">
|
||||
<div class="p-field">
|
||||
<label for="firstname" class="p-sr-only">Firstname</label>
|
||||
|
@ -95,12 +106,14 @@
|
|||
</div>
|
||||
<Button type="button" label="Submit" />
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Checkbox and RadioButton</h5>
|
||||
<p>Checkbox and RadioButton have exclusive layout support via <i>.p-field-checkbox</i> and <i>.p-field-radiobutton</i> classes respectively.
|
||||
Examples here demonstrates vertical and horizontal layout alternatives.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h3>Vertical Checkbox</h3>
|
||||
<div class="p-field-checkbox">
|
||||
<Checkbox id="city1" name="city1" value="Chicago" v-model="cities1" />
|
||||
|
@ -122,9 +135,11 @@
|
|||
<label for="city4">Los Angeles</label>
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h3>Vertical RadioButton</h3>
|
||||
<div class="p-field-radiobutton">
|
||||
<RadioButton id="city5" name="city1" value="Chicago" v-model="city1" />
|
||||
|
@ -146,21 +161,25 @@
|
|||
<label for="city8">Los Angeles</label>
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Helper text</h5>
|
||||
<p>Helper text is an optional element defined with the <i>small</i> tag to display additional information about the input field.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-field p-fluid">
|
||||
<label for="username">Username</label>
|
||||
<InputText id="username" type="username" aria-describedby="username-help" />
|
||||
<small id="username-help">Enter your username to reset your password.</small>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Advanced Forms</h5>
|
||||
<p>A responsive form with various input fields can easily be implemented using a combination of <i>.p-field</i>, <i>.p-formgrid</i> and <i>.p-fluid</i>.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-fluid p-formgrid p-grid">
|
||||
<div class="p-field p-col-12 p-md-6">
|
||||
<label for="firstname">Firstname</label>
|
||||
|
@ -187,7 +206,8 @@
|
|||
<InputText id="zip" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Customization</h5>
|
||||
<p>FormLayout comes with sensible defaults, in case these values need to be customized suggested way is building <a href="https://github.com/primefaces/primeflex/blob/master/primeflex.scss">primeflex.scss</a> with your on variables.</p>
|
||||
|
@ -219,8 +239,8 @@
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/formlayout" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Vertical</h3>
|
||||
<div class="p-fluid">
|
||||
<div class="p-field">
|
||||
|
@ -367,9 +387,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -388,7 +409,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,37 +3,48 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import FullCalendar from 'primevue/fullcalendar';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>FullCalendar is a wrapper around on <a href="https://fullcalendar.io/docs/v4">FullCalendar 4.0.0+</a> so fullcalendar needs to be included in your project.
|
||||
For a complete documentation and samples please refer to the <a href="https://fullcalendar.io/">fullcalendar website</a>.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
npm install @fullcalendar/core --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>FullCalendar is plugin based so install the plugins you require and define them with the options property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
npm install @fullcalendar/daygrid --save
|
||||
npm install @fullcalendar/timegrid --save
|
||||
npm install @fullcalendar/interaction --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Include the core style and the styles of the plugins that you use in your application.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
import '@fullcalendar/core/main.min.css';
|
||||
import '@fullcalendar/daygrid/main.min.css';
|
||||
import '@fullcalendar/timegrid/main.min.css';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Events should be an array and defined using the events property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FullCalendar :events="events" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -75,10 +86,12 @@ export default {
|
|||
};
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>In a real application, it is likely to populate the events by making a remote call, when the events are updated, the component will detect the change and render them.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import axios from 'axios';
|
||||
|
||||
export default class EventService {
|
||||
|
@ -87,9 +100,11 @@ export default class EventService {
|
|||
return axios.get('demo/data/events.json').then(res => res.data.data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import EventService from '../../service/EventService';
|
||||
|
||||
export default {
|
||||
|
@ -106,15 +121,19 @@ export default {
|
|||
this.eventService.getEvents().then(data => this.events = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Options</h5>
|
||||
<p>FullCalendar has a long list of customization parameters that can be defined with the options property. Example below customizes the plugins, header and editable properties.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<FullCalendar :events="events" :options="options" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import EventService from '../../service/EventService';
|
||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import timeGridPlugin from '@fullcalendar/timegrid';
|
||||
|
@ -144,11 +163,13 @@ export default {
|
|||
this.eventService.getEvents().then(data => this.events = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Callbacks</h5>
|
||||
<p>Callbacks of the FullCalendar such as dateClick are also defined with the options property.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -168,7 +189,8 @@ export default {
|
|||
};
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -204,13 +226,14 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/fullcalendar" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<FullCalendar :events="events" :options="options" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import EventService from '../../service/EventService';
|
||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import timeGridPlugin from '@fullcalendar/timegrid';
|
||||
|
@ -240,7 +263,8 @@ export default {
|
|||
this.eventService.getEvents().then(data => this.events = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Galleria ref="galleria" :value="images" :activeIndex.sync="activeIndex" :numVisible="5" style="max-width: 640px;" :class="galleriaClass"
|
||||
:showThumbnails="showThumbnails" :showItemNavigators="true" :showItemNavigatorsOnHover="true"
|
||||
:circular="true" :autoPlay="true" :transitionInterval="3000">
|
||||
|
@ -64,9 +64,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -97,9 +98,11 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
::v-deep(.custom-galleria) {
|
||||
&.fullscreen {
|
||||
display: flex;
|
||||
|
@ -160,7 +163,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px"
|
||||
:circular="true" :autoPlay="true" :transitionInterval="2000">
|
||||
<template #item="slotProps">
|
||||
|
@ -36,9 +36,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -69,7 +70,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
|
||||
<template #item="{item}">
|
||||
<img :src="item.itemImageSrc" :alt="item.alt" style="width: 100%; display: block;" />
|
||||
|
@ -46,9 +46,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -79,7 +80,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,23 +3,28 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Galleria from 'primevue/galleria';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Galleria requires item template and a value as an array of objects.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Galleria :value="images">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" />
|
||||
</template>
|
||||
</Galleria>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>For the rest of the documentation, sample data below would be return from an example service e.g. PhotoService.</p>
|
||||
<div style="overflow: auto; height: 400px">
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
{
|
||||
"data":[
|
||||
{
|
||||
|
@ -114,10 +119,12 @@ import Galleria from 'primevue/galleria';
|
|||
}
|
||||
]
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import axios from 'axios'
|
||||
|
||||
export default class PhotoService {
|
||||
|
@ -126,9 +133,11 @@ export default class PhotoService {
|
|||
return axios.get('demo/data/photos.json').then(res => res.data.data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -143,12 +152,14 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Items per page</h5>
|
||||
<p>Number of items per page is defined using the <i>numVisible</i> property.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Galleria :value="images" :numVisible="5">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
|
||||
|
@ -157,13 +168,15 @@ export default {
|
|||
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
|
||||
</template>
|
||||
</Galleria>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Responsive</h5>
|
||||
<p>For responsive design, <i>numVisible</i> can be defined using the <i>responsiveOptions</i> property which references an array of
|
||||
objects whose breakpoint defines the max-width to apply the settings.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
|
||||
|
@ -172,9 +185,11 @@ export default {
|
|||
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
|
||||
</template>
|
||||
</Galleria>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
responsiveOptions: [
|
||||
{
|
||||
breakpoint: '1024px',
|
||||
|
@ -189,11 +204,13 @@ responsiveOptions: [
|
|||
numVisible: 1
|
||||
}
|
||||
]
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Header and Footer</h5>
|
||||
<p>Custom content projection is available using the <i>header</i> and <i>footer</i> properties.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
|
||||
<template #header>
|
||||
<h1>Header</h1>
|
||||
|
@ -205,18 +222,21 @@ responsiveOptions: [
|
|||
<h1>Footer</h1>
|
||||
</template>
|
||||
</Galleria>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Indicators</h5>
|
||||
<p>Indicators allow quick navigation between the items. Set <i>showIndicators</i> to display indicators which can be customized further
|
||||
with the <i>changeItemOnIndicatorHover</i>, <i>showIndicatorsOnItem</i> and <i>indicatorsPosition</i> properties.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Galleria :value="images" :showIndicators="true">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" />
|
||||
</template>
|
||||
</Galleria>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -438,8 +458,8 @@ responsiveOptions: [
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/galleria" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
|
||||
|
@ -449,9 +469,10 @@ responsiveOptions: [
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -482,7 +503,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
|
|
|
@ -61,8 +61,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>With Thumbnails</h3>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions2" :numVisible="9" containerStyle="max-width: 50%"
|
||||
:circular="true" :fullScreen="true" :showItemNavigators="true" :visible.sync="displayBasic">
|
||||
|
@ -106,9 +106,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -167,7 +168,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -87,8 +87,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Indicators with Click Event</h3>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px"
|
||||
:showThumbnails="false" :showIndicators="true">
|
||||
|
@ -150,9 +150,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -187,9 +188,11 @@ export default {
|
|||
});
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
::v-deep(.custom-indicator-galleria) {
|
||||
.indicator-text {
|
||||
color: #e9ecef;
|
||||
|
@ -202,7 +205,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Item Navigators and Thumbnails</h3>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 640px"
|
||||
:showItemNavigators="true">
|
||||
|
@ -110,9 +110,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -143,7 +144,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div style="padding: .5rem 0">
|
||||
<Button icon="pi pi-minus" @click="prev" class="p-button-secondary" />
|
||||
<Button icon="pi pi-plus" @click="next" class="p-button-secondary" style="margin-left: .5rem" />
|
||||
|
@ -44,9 +44,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -86,7 +87,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="7" :circular="true" style="max-width: 800px">
|
||||
<template #item="slotProps">
|
||||
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
|
||||
|
@ -34,9 +34,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -71,7 +72,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Source">
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Positioned at Bottom</h3>
|
||||
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 640px">
|
||||
<template #item="slotProps">
|
||||
|
@ -110,9 +110,10 @@
|
|||
</template>
|
||||
</Galleria>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PhotoService from '../../service/PhotoService';
|
||||
|
||||
export default {
|
||||
|
@ -153,7 +154,8 @@ export default {
|
|||
this.galleriaService.getImages().then(data => this.images = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -5,13 +5,15 @@
|
|||
<h5>Getting Started</h5>
|
||||
<p>FlexGrid is a CSS utility based on flexbox. For more information about Flex, visit <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">A Complete Guide to Flexbox</a>. A basic grid is defined by giving
|
||||
a container <i>p-grid</i> class and children the <i>p-col</i> class. Children of the grid will have the same width and scale according to the width of the parent.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col">1</div>
|
||||
<div class="p-col">2</div>
|
||||
<div class="p-col">3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col">
|
||||
|
@ -29,7 +31,8 @@
|
|||
<p>FlexGrid includes a 12 column based layout utility where width of a column is defined with the <i>p-col-{number}</i> style class. Columns with prefined widths can be used with columns with auto width (p-col) as well.</p>
|
||||
|
||||
<p>In the first example below, first column covers the 4 units out of 12 and the rest of the columns share the remaining space whereas in the second example, all three columns have explicit units.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col-4">4</div>
|
||||
<div class="p-col">1</div>
|
||||
|
@ -47,7 +50,8 @@
|
|||
<div class="p-col-6">6</div>
|
||||
<div class="p-col-4">4</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-4">
|
||||
|
@ -93,14 +97,16 @@
|
|||
|
||||
<h5>MultiLine</h5>
|
||||
<p>When the number of columns exceed 12, columns wrap to a new line.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">6</div>
|
||||
<div class="p-col-6">6</div>
|
||||
<div class="p-col-6">6</div>
|
||||
<div class="p-col-6">6</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">
|
||||
|
@ -119,12 +125,14 @@
|
|||
|
||||
<h5>Fixed Width Column</h5>
|
||||
<p>A column can have a fixed width while siblings having auto width. Apply <i>p-col-fixed</i> class to fix a column width.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col-fixed" style="width:100px">Fixed</div>
|
||||
<div class="p-col">Auto</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-fixed" style="width:100px">
|
||||
|
@ -176,14 +184,16 @@
|
|||
</div>
|
||||
|
||||
<p>In example below, large screens display 4 columns, medium screens display 2 columns in 2 rows and finally on small devices, columns are stacked.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col-12 p-md-6 p-lg-3">A</div>
|
||||
<div class="p-col-12 p-md-6 p-lg-3">B</div>
|
||||
<div class="p-col-12 p-md-6 p-lg-3">C</div>
|
||||
<div class="p-col-12 p-md-6 p-lg-3">D</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-12 p-md-6 p-lg-3">
|
||||
|
@ -201,7 +211,8 @@
|
|||
</div>
|
||||
<h5>Offset</h5>
|
||||
<p>Offset classes allow defining a left margin on a column to avoid adding empty columns for spacing.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6 p-offset-3">6</div>
|
||||
</div>
|
||||
|
@ -210,7 +221,8 @@
|
|||
<div class="p-col-4">4</div>
|
||||
<div class="p-col-4 p-offset-4">4</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6 p-offset-3">
|
||||
|
@ -274,7 +286,8 @@
|
|||
|
||||
<h5>Nested</h5>
|
||||
<p>Columns can be nested to create more complex layouts.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid nested-grid">
|
||||
<div class="p-col-8">
|
||||
<div class="p-grid">
|
||||
|
@ -293,7 +306,8 @@
|
|||
4
|
||||
</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<div class="p-grid nested-grid">
|
||||
<div class="p-col-8">
|
||||
|
@ -318,21 +332,23 @@
|
|||
<p>A .5rem padding is applied to each column along with negative margins on the container element, in case you'd like to remove these gutters, apply
|
||||
<i>p-nogutter</i> class to the container. Gutters can also be removed on an ndividual columns with the same class name.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-grid p-nogutter">
|
||||
<div class="p-col">1</div>
|
||||
<div class="p-col p-nogutter">2</div>
|
||||
<div class="p-col">3</div>
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
|
||||
<TabPanel header="Source">
|
||||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/flexgrid" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<div class="p-grid">
|
||||
<div class="p-col">
|
||||
|
@ -701,9 +717,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -719,9 +736,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.flexgrid-demo {
|
||||
.box {
|
||||
background-color: var(--surface-e);
|
||||
|
@ -763,7 +782,8 @@ export default {
|
|||
margin: 0;
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -7,18 +7,22 @@
|
|||
<h5>Download</h5>
|
||||
<p>PrimeIcons is available at npm, run the following command to download it to your project.</p>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
npm install primeicons --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>PrimeIcons use the <strong>pi pi-{icon}</strong> syntax such as <strong>pi pi-check</strong>.
|
||||
A standalone icon can be displayed using an element like <i>i</i> or <i>span</i></p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<i class="pi pi-check"></i>
|
||||
<i class="pi pi-times"></i>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<i class="pi pi-check" style="margin-right: .5rem"></i>
|
||||
<i class="pi pi-times"></i>
|
||||
|
@ -26,23 +30,29 @@ npm install primeicons --save
|
|||
<h5>Size</h5>
|
||||
<p>Size of the icons can easily be changed using font-size property.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<i class="pi pi-check"></i>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<i class="pi pi-check"></i>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<i class="pi pi-check" style="fontSize: 2rem"></i>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<i class="pi pi-check" style="fontSize: 2rem"></i>
|
||||
|
||||
<h5>Spinning Animation</h5>
|
||||
<p>Special pi-spin class applies continuous rotation to an icon.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<i class="pi pi-spin pi-spinner" style="fontSize: 2rem"></i>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<i class="pi pi-spin pi-spinner" style="fontSize: 2rem"></i>
|
||||
|
||||
|
|
|
@ -3,15 +3,17 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Inplace from 'primevue/inplace';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Inplace requires <i>display</i> and <i>content</i> templates to define the content of each state.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Inplace>
|
||||
<template #display>
|
||||
<span class="pi pi-search" style="vertical-align: middle"></span>
|
||||
|
@ -22,12 +24,12 @@ import Inplace from 'primevue/inplace';
|
|||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Closable</h5>
|
||||
<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>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Inplace :closable="true">
|
||||
<template #display>
|
||||
{{text || 'Click to Edit'}}
|
||||
|
@ -37,12 +39,12 @@ import Inplace from 'primevue/inplace';
|
|||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Lazy Data</h5>
|
||||
<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>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Inplace @open="loadData">
|
||||
<template #display>
|
||||
View Data
|
||||
|
@ -57,9 +59,10 @@ import Inplace from 'primevue/inplace';
|
|||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import CarService from '../../service/CarService';
|
||||
|
||||
export default {
|
||||
|
@ -78,7 +81,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -169,8 +173,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inplace" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Input</h3>
|
||||
<Inplace :closable="true">
|
||||
<template #display>
|
||||
|
@ -207,9 +211,10 @@ export default {
|
|||
</template>
|
||||
</Inplace>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -229,7 +234,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputgroup" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Addons</h3>
|
||||
<div class="p-grid p-fluid">
|
||||
<div class="p-col-12 p-md-4">
|
||||
|
@ -109,9 +109,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -122,7 +123,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,15 +3,19 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import InputMask from 'primevue/inputmask';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>A model can be bound using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputMask v-model="value" mask="99-999999" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Mask</h5>
|
||||
<p>Mask format can be a combination of the the following built-in definitions.</p>
|
||||
|
@ -27,23 +31,29 @@ import InputMask from 'primevue/inputmask';
|
|||
* - Alpha numberic character (A-Z,a-z,0-9)
|
||||
</li>
|
||||
</ul>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputMask v-model="value" mask="a*-999-a999" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>SlotChar</h5>
|
||||
<p>Underscore is the default placeholder for a mask and this can be customized using <i>slotChart</i> option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputMask v-model="value" mask="99/99/9999" slotChar="mm/dd/yyyy" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<h5>Optional Values</h5>
|
||||
<p>If the input does not complete the mask definition, it is cleared by default.
|
||||
Use <i>autoClear</i> property to control this behavior. In addition, certain part of
|
||||
a mask can be made optional by using ? symbol where anything after the question
|
||||
mark becomes optional.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputMask v-model="value" mask="(999) 999-9999? x99999" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>InputText passes any valid attribute to the underlying input element. In addition;</p>
|
||||
|
@ -122,8 +132,8 @@ import InputMask from 'primevue/inputmask';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="p-fluid p-formgrid p-grid">
|
||||
<div class="p-field p-col-12 p-md-4">
|
||||
<label for="basic">Basic</label>
|
||||
|
@ -156,9 +166,10 @@ import InputMask from 'primevue/inputmask';
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -171,7 +182,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,31 +3,40 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import InputNumber from 'primevue/inputnumber';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>InputNumber is used with the standard v-model directive. Component always provides a number type although formatting on the input is a string.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputNumber v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Decimal Mode</h5>
|
||||
<p>Format is defined using the <i>mode</i> property, "decimal" is the default value allowing only integers when there is no other configuration.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputNumber v-model="value" mode="decimal" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Fractions are configured with the <i>minFractionDigits</i> property. Optionally <i>maxFractionDigits</i> can be used to defined a boundary for the maximum digits.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputNumber v-model="value1" mode="decimal" :minFractionDigits="2" />
|
||||
<InputNumber v-model="value2" mode="decimal" :minFractionDigits="2" :maxFractionDigits="2" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p><i>locale</i> option is available to set the localization information such as grouping and decimal symbols where default value is the browser locale. Locales are defined per <a href="https://tools.ietf.org/html/rfc5646">BCP Language Tag</a>.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
User Locale
|
||||
<InputNumber v-model="value1" mode="decimal" :minFractionDigits="2" />
|
||||
|
||||
|
@ -39,12 +48,14 @@ German Locale
|
|||
|
||||
Indian Locale
|
||||
<InputNumber v-model="value4" mode="decimal" locale="en-IN" :minFractionDigits="2" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Currency</h5>
|
||||
<p>Currency formatting is specified by setting the <i>mode</i> option to currency and <i>currency</i> property. In addition <i>currencyDisplay</i> option
|
||||
allows how the currency is displayed, valid values are "symbol" (default) or "code".</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
United States
|
||||
<InputNumber v-model="value1" mode="currency" currency="USD" locale="en-US" />
|
||||
|
||||
|
@ -56,11 +67,13 @@ India
|
|||
|
||||
Japan
|
||||
<InputNumber v-model="value4" mode="currency" currency="JPY" locale="jp-JP" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Prefix and Suffix</h5>
|
||||
<p>Custom texts e.g. units can be placed before or after the input section with the <i>prefix</i> and <i>suffix</i> properties.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
Mile
|
||||
<InputNumber v-model="value1" suffix=" mi" />
|
||||
|
||||
|
@ -72,12 +85,14 @@ Expiry
|
|||
|
||||
Temperature
|
||||
<InputNumber v-model="value4" prefix="↑ " suffix="℃" :min="0" :max="40" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Buttons</h5>
|
||||
<p>Spinner buttons is enabled using the <i>showButtons</i> options and layout is defined with the <i>buttonLayout</i>. Default value is "stacked" whereas
|
||||
"horizontal" and "stacked" are alternatives. Note that even there are no buttons, up and down arrow keys can be used to spin the values with keyboard.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
Stacked
|
||||
<InputNumber v-model="value1" showButtons mode="currency" currency="USD" />
|
||||
|
||||
|
@ -88,20 +103,25 @@ Horizontal
|
|||
Vertical
|
||||
<InputNumber v-model="value3" mode="decimal" showButtons buttonLayout="vertical"
|
||||
decrementButtonClass="p-button-secondary" incrementButtonClass="p-button-secondary" incrementButtonIcon="pi pi-plus" decrementButtonIcon="pi pi-minus" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Step</h5>
|
||||
<p>Step factor is 1 by default and can be customized with <i>step</i> option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputNumber v-model="value" :step="0.25" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
|
||||
<h5>Min and Max Boundaries</h5>
|
||||
<p>Value to be entered can be restricted by configuring the <i>min</i> and <i>max</i> options.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputNumber v-model="value" :min="0" :max="100" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
|
||||
<h5>Properties</h5>
|
||||
|
@ -318,8 +338,8 @@ Vertical
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Numerals</h3>
|
||||
<div class="p-fluid p-grid p-formgrid">
|
||||
<div class="p-field p-col-12 p-md-3">
|
||||
|
@ -420,9 +440,10 @@ Vertical
|
|||
decrementButtonClass="p-button-secondary" incrementButtonClass="p-button-secondary" incrementButtonIcon="pi pi-plus" decrementButtonIcon="pi pi-minus" />
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -449,7 +470,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import InputSwitch from 'primevue/inputswitch';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Two-way binding to a boolean property is defined using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputSwitch v-model="checked" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -21,11 +26,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>As model is two-way binding enabled, setting the bound value as true displays the state as checked by default.</p>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -33,7 +40,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as name and placeholder are passed to the underlying input element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -96,17 +104,18 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputswitch" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic</h3>
|
||||
<InputSwitch v-model="checked1" />
|
||||
|
||||
<h3>Preselection</h3>
|
||||
<InputSwitch v-model="checked2" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -115,7 +124,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,29 +3,36 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import InputText from 'primevue/inputtext';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>A model can be bound using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputText type="text" v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Float Label</h5>
|
||||
<p>A floating label is implemented by wrapping the input and the label inside a container having <i>.p-float-label</i> style class.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-float-label">
|
||||
<InputText id="username" type="text" v-model="value" />
|
||||
<label for="username">Username</label>
|
||||
</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Icons</h5>
|
||||
<p>An icon can be integrated within an input field by wrapping the input and the icon with an element having <i>p-input-icon-right</i>
|
||||
and <i>p-input-icon-left</i> classes depending on the icon location.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<span class="p-input-icon-left">
|
||||
<i class="pi pi-search" />
|
||||
<InputText type="text" v-model="value1" placeholder="Search" />
|
||||
|
@ -41,39 +48,46 @@ import InputText from 'primevue/inputtext';
|
|||
<InputText type="text" v-model="value3" />
|
||||
<i class="pi pi-spin pi-spinner" />
|
||||
</span>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Sizes</h5>
|
||||
<p>2 more sizes are available in addition to a regular input, for a smaller input add <i>p-inputtext-sm</i> and for a larger one, use <i>p-inputtext-lg</i>.
|
||||
Note that these classes are mainly be used to change the size of a particular field, for global scaling see the <router-link to="/theming">theming</router-link> page.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputText type="text" class="p-inputtext-sm" placeholder="Small" />
|
||||
<InputText type="text" placeholder="Normal" />
|
||||
<InputText type="text" class="p-inputtext-lg" placeholder="Large" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Instead of repeating the scale classes for each input, sizing can also be applied to a group by adding the
|
||||
class to a container element so that descendant inputs share the same style easier.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-inputtext-sm">
|
||||
<InputText />
|
||||
<InputNumber />
|
||||
<InputMask />
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Outlined vs Filled</h5>
|
||||
<p>Input fields come in two styles, default is <i>outlined</i> with borders around the field whereas <i>filled</i> alternative adds a background color
|
||||
to the field. Applying <i>p-input-filled</i> to an ancestor of an input enables the filled style. If you prefer
|
||||
to use filled inputs in the entire application, use a global container such as document body or the application element to apply the style class.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<div class="p-input-filled">
|
||||
<InputText type="text" />
|
||||
<InputText type="text" />
|
||||
<InputText type="text" />
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>InputText passes any valid attribute to the underlying input element, additional attribute is the following.</p>
|
||||
|
@ -140,8 +154,8 @@ import InputText from 'primevue/inputtext';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/inputtext" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<div class="card">
|
||||
<h5>Basic</h5>
|
||||
<InputText type="text" v-model="value1" />
|
||||
|
@ -190,9 +204,10 @@ import InputText from 'primevue/inputtext';
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -204,7 +219,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Listbox from 'primevue/listbox';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Listbox requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the label property of the option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Listbox v-model="selectedCity" :options="cities" optionLabel="name" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
selectedCity: null,
|
||||
|
@ -26,20 +31,23 @@ data() {
|
|||
]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection</h5>
|
||||
<p>Listbox allows selection of either single or multiple items. In single case, model should be a single object reference whereas in multiple case should be an array. Multiple items can either be selected
|
||||
using metaKey or toggled individually depending on the value of <i>metaKeySelection</i> property value which is true by default. On touch enabled
|
||||
devices metaKeySelection is turned off automatically.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Listbox v-model="selectedCity" :options="cities" optionLabel="name" :multiple="true"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>option</i> template that gets the option instance as a parameter.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Listbox v-model="selectedCars" :options="cars" :multiple="true" :filter="true" optionLabel="brand" listStyle="max-height:250px" style="width:15em">
|
||||
<template #option="slotProps">
|
||||
<div>
|
||||
|
@ -49,13 +57,15 @@ data() {
|
|||
</template>
|
||||
</Listbox>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Filter</h5>
|
||||
<p>Filtering allows searching items in the list using an input field at the header. In order to use filtering, enable <i>filter</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Listbox v-model="selectedCity" :options="cities" optionLabel="name" :filter="true"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -229,8 +239,8 @@ data() {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/listbox" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Single</h5>
|
||||
<Listbox v-model="selectedCity" :options="cities" optionLabel="name" style="width:15rem" />
|
||||
|
||||
|
@ -244,9 +254,10 @@ data() {
|
|||
</template>
|
||||
</Listbox>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -274,7 +285,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import MegaMenu from 'primevue/megamenu';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>MegaMenu uses the common MenuModel API to define the items of the model, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<MegaMenu :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -132,24 +137,27 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Orientation</h5>
|
||||
<p>Default orientation is "horizontal" with "vertical" as the alternative.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<MegaMenu :model="items" orientation="vertical" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Any content inside the megamenu will be displayed on the right side by default. You may use ".p-megamenu-custom" style class to change the location of the content.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<MegaMenu :model="items">
|
||||
<InputText placeholder="Search" type="text" />
|
||||
<Button label="Logout" icon="pi pi-power-off" />
|
||||
</MegaMenu>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -247,17 +255,18 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/megamenu" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Horizontal</h3>
|
||||
<MegaMenu :model="items" />
|
||||
|
||||
<h3>Vertical</h3>
|
||||
<MegaMenu :model="items" orientation="vertical"/>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -376,7 +385,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,20 +3,25 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Menu from 'primevue/menu';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>Menu uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Menu requires a collection of menuitems as its model.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Menu :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -49,11 +54,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>SubMenus</h5>
|
||||
<p>Menu supports one level of nesting via subitems of an item.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
const items: [
|
||||
{
|
||||
label: 'Options',
|
||||
|
@ -66,21 +73,26 @@ const items: [
|
|||
{label: 'Sign Out', icon: 'pi pi-fw pi-power-off', to: '/logout'} ]
|
||||
}
|
||||
];
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Popup Mode</h5>
|
||||
<p>Menu is inline by default whereas popup mode is supported by enabling popup property and calling toggle method with an event of the target.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Button type="button" label="Toggle" @click="toggle" />
|
||||
<Menu ref="menu" :model="items" :popup="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
toggle(event) {
|
||||
this.$refs.menu.toggle(event);
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -203,8 +215,8 @@ toggle(event) {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/menu" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Inline</h3>
|
||||
<Menu :model="items" />
|
||||
|
||||
|
@ -212,9 +224,10 @@ toggle(event) {
|
|||
<Button type="button" label="Toggle" @click="toggle" aria-haspopup="true" aria-controls="overlay_menu" />
|
||||
<Menu id="overlay_menu" ref="menu" :model="items" :popup="true" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -261,7 +274,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,20 +3,25 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Menubar from 'primevue/menubar';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>Menubar uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Menubar requires a collection of menuitems as its model.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Menubar :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -151,12 +156,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Two slots named "start" and "end" are provided to embed content before or after the menubar.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Menubar :model="items">
|
||||
<template #start>
|
||||
Before
|
||||
|
@ -166,7 +172,7 @@ export default {
|
|||
</template>
|
||||
</Menubar>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -242,8 +248,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/menubar" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Menubar :model="items">
|
||||
<template #start>
|
||||
<img alt="logo" src="../../assets/images/logo.svg" height="40" class="p-mr-2">
|
||||
|
@ -254,9 +260,10 @@ export default {
|
|||
</template>
|
||||
</Menubar>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -391,7 +398,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
<h5>MenuItem</h5>
|
||||
<p>Core of the API is the MenuItem class that defines various options such as the label, icon and children of an item in a menu.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
const items: [
|
||||
{
|
||||
label: 'Options',
|
||||
|
@ -19,7 +20,8 @@ const items: [
|
|||
{label: 'Sign Out', icon: 'pi pi-fw pi-power-off', to: '/logout'} ]
|
||||
}
|
||||
];
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>MenuItem provides the following properties. Note that not all of them may be utilized by the corresponding menu component.</p>
|
||||
|
||||
|
@ -112,7 +114,8 @@ const items: [
|
|||
|
||||
<h5>Command</h5>
|
||||
<p>The function to invoke when an item is clicked is defined using the command property.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
const items = [
|
||||
{
|
||||
label: 'New',
|
||||
|
@ -123,11 +126,13 @@ const items = [
|
|||
}
|
||||
}
|
||||
];
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Navigation</h5>
|
||||
<p>Navigation is specified using <i>url</i> property for external links or using <i>to</i> property for internal routing.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
const items = [
|
||||
{
|
||||
label: 'Internal',
|
||||
|
@ -140,12 +145,14 @@ const items = [
|
|||
url: 'https://www.primefaces.org/primevue'
|
||||
}
|
||||
];
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Visibility</h5>
|
||||
<p>It is a common case to hide certain items based on conditions such as user roles, <i>visible</i> property is available
|
||||
to implement such cases by supporting functions that returns booleans or simple booleans.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
const items = [
|
||||
{
|
||||
label: 'Remove',
|
||||
|
@ -156,7 +163,8 @@ const items = [
|
|||
visible: () => this.isUserAdmin()
|
||||
}
|
||||
];
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
|
@ -3,25 +3,30 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Message from 'primevue/message';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Message component requires a content to display.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Message>Welcome to PrimeVue</Message>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Multiple messages can be displayed using the standard v-for directive.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Message v-for="msg of messages" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
messages: [
|
||||
|
@ -31,7 +36,8 @@ data() {
|
|||
]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Severities</h5>
|
||||
<p>There are four possible values for the severity of a message. Default one is "info".</p>
|
||||
|
@ -45,27 +51,35 @@ data() {
|
|||
|
||||
<h5>Closable</h5>
|
||||
<p>Messages are closable by default resulting in a close icon being displayed on top right corner. In order to disable closable messages, set <i>closable</i> to false.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Message severity="success" :closable="false">Order Submitted</Message>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Sticky</h5>
|
||||
<p>Messages are sticky by default, if you require them to be cleared automatically, disable <i>sticky</i> property and optionally configure the <i>life</i> property to specify how long the message
|
||||
should be displayed which is 3000 ms by default.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Message severity="warn" :life="5000" :sticky="false">This message will hide in 5 seconds.</Message>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Inline Message Component</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import InlineMessage from 'primevue/inlinemessage';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>InlineMessage component is useful in cases where a single message needs to be displayed related to an element such as forms. It has one property, <i>severity</i> of the message.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<InputText placeholder="Username" class="p-invalid" />
|
||||
<InlineMessage>Field is required</InlineMessage>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
|
||||
<h5>Properties of Message</h5>
|
||||
|
@ -229,8 +243,8 @@ import InlineMessage from 'primevue/inlinemessage';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/message" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Severities</h5>
|
||||
<Message severity="success">Success Message Content</Message>
|
||||
<Message severity="info">Info Message Content</Message>
|
||||
|
@ -258,9 +272,10 @@ import InlineMessage from 'primevue/inlinemessage';
|
|||
<InlineMessage />
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -278,9 +293,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
button.p-button {
|
||||
margin-right: .5rem;
|
||||
}
|
||||
|
@ -288,7 +305,8 @@ button.p-button {
|
|||
.p-inputtext {
|
||||
margin-right: .25rem;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import MultiSelect from 'primevue/multiselect';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>MultiSelect requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the label property of the option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<MultiSelect v-model="selectedCars" :options="cars" optionLabel="brand" placeholder="Select Brands" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
selectedCars: null,
|
||||
|
@ -30,13 +35,14 @@ data() {
|
|||
]
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Content</h5>
|
||||
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>option</i> template that gets the option instance as a parameter.</p>
|
||||
<p>In addition the <i>value</i> template can be used to customize the selected values display instead of the default comma separated list.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<MultiSelect v-model="selectedCars2" :options="cars" optionLabel="brand" placeholder="Select a Car">
|
||||
<template #value="slotProps">
|
||||
<div class="p-multiselect-car-token" v-for="option of slotProps.value" :key="option.brand">
|
||||
|
@ -55,13 +61,15 @@ data() {
|
|||
</template>
|
||||
</MultiSelect>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Filter</h5>
|
||||
<p>Filtering allows searching items in the list using an input field at the header. In order to use filtering, enable the <i>filter</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<MultiSelect v-model="selectedCars" :options="cars" :filter="true" optionLabel="brand" placeholder="Select Brands"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -309,8 +317,8 @@ data() {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/multiselect" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Basic</h5>
|
||||
<MultiSelect v-model="selectedCities" :options="cities" optionLabel="name" placeholder="Select a City" />
|
||||
|
||||
|
@ -333,9 +341,10 @@ data() {
|
|||
</template>
|
||||
</MultiSelect>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -363,9 +372,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.p-multiselect {
|
||||
min-width: 15rem;
|
||||
}
|
||||
|
@ -389,7 +400,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import OrderList from 'primevue/orderlist';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>OrderList requires an array as its value bound with the v-model directive and a template for its content.</p>
|
||||
<p>Header of the component is defined with the "header" template and to define the content of an item in the list a named template called "item" needs to be defined which gets the
|
||||
<i>item</i> and the <i>index</i> via slotProps.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrderList v-model="cars" listStyle="height:auto" dataKey="vin">
|
||||
<template #header>
|
||||
List of Cars
|
||||
|
@ -29,7 +31,7 @@ import OrderList from 'primevue/orderlist';
|
|||
</template>
|
||||
</OrderList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection</h5>
|
||||
<p>In case you'd need to access the selected items in the list, define a binding to the <i>selection</i> property with the v-model directive so that
|
||||
|
@ -38,8 +40,8 @@ import OrderList from 'primevue/orderlist';
|
|||
|
||||
<p>Use the v-model directive to enable two-way binding.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrderList v-model="cars" dataKey="vin" v-model:selection="selection">
|
||||
<template #header>
|
||||
List of Cars
|
||||
|
@ -55,7 +57,7 @@ import OrderList from 'primevue/orderlist';
|
|||
</template>
|
||||
</OrderList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>DataKey</h5>
|
||||
<p>It is recommended to provide the name of the field that uniquely identifies the a record in the data via the <i>dataKey</i> property for better performance.</p>
|
||||
|
@ -168,8 +170,8 @@ import OrderList from 'primevue/orderlist';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/orderlist" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrderList v-model="products" listStyle="height:auto" dataKey="id">
|
||||
<template #header>
|
||||
List of Products
|
||||
|
@ -192,9 +194,10 @@ import OrderList from 'primevue/orderlist';
|
|||
</template>
|
||||
</OrderList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -211,9 +214,11 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = data);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.product-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -262,7 +267,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,23 +3,26 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import OrganizationChart from 'primevue/organizationchart';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>OrganizationChart requires an OrganizationChartNode instance as its root value and at least one template to display node content where node instance is passed via slotProps.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrganizationChart :value="data">
|
||||
<template #default="slotProps">
|
||||
<span>{{slotProps.node.data.label}}</span>
|
||||
</template>
|
||||
</OrganizationChart>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -60,7 +63,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>OrganizationChartNode</h5>
|
||||
<p>API of the OrganizationChartNode has the properties below.</p>
|
||||
|
@ -128,17 +132,18 @@ export default {
|
|||
<p>Example below displays the root of chart in previous example as collapsed. Notice that the collapsedKeys is a map whose key is the
|
||||
key of the node and value is true.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrganizationChart :value="data" :collapsible="true" :collapsedKeys="collapsedKeys">
|
||||
<template #default="slotProps">
|
||||
<span>{{slotProps.node.data.label}}</span>
|
||||
</template>
|
||||
</OrganizationChart>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -182,22 +187,24 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection</h5>
|
||||
<p>Selection is enabled by defining the <i>selectionMode</i> to either "single" or "multiple" and specifying the <i>selectionKeys</i> with the sync operator. Note that
|
||||
selection on a particular node can be disabled if the <i>selectable</i> is false on the node instance.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrganizationChart :value="data" selecionMode="single" :selectionKeys.sync="selectionKeys">
|
||||
<template #default="slotProps">
|
||||
<span>{{slotProps.node.data.label}}</span>
|
||||
</template>
|
||||
</OrganizationChart>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -239,13 +246,14 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Templating</h5>
|
||||
<p>The <i>type</i> property of an OrganizationChartNode is used to map a template to a node. If it is undefined, the default template is used.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<OrganizationChart :value="data">
|
||||
<template #person="slotProps">
|
||||
<div class="node-header ui-corner-top">{{slotProps.node.data.label}}</div>
|
||||
|
@ -259,9 +267,10 @@ export default {
|
|||
</template>
|
||||
</OrganizationChart>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -348,7 +357,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -483,8 +493,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/organizationchart" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Advanced</h3>
|
||||
<OrganizationChart :value="data1" :collapsible="true" class="company" selectionMode="single" :selectionKeys.sync="selection"
|
||||
@node-select="onNodeSelect" @node-unselect="onNodeUnselect" @node-collapse="onNodeCollapse" @node-expand="onNodeExpand">
|
||||
|
@ -507,9 +517,10 @@ export default {
|
|||
</template>
|
||||
</OrganizationChart>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -645,9 +656,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
::v-deep(.p-organizationchart) {
|
||||
.p-person {
|
||||
padding: 0;
|
||||
|
@ -687,7 +700,8 @@ export default {
|
|||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,34 +3,42 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import OverlayPanel from 'primevue/overlaypanel';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>OverlayPanel is accessed via its reference where visibility is controlled using toggle, show and hide methods.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<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">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
toggle(event) {
|
||||
this.$refs.op.toggle(event);
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Dismissable and CloseIcon</h5>
|
||||
<p>Clicking outside the overlay hides the panel, setting <i>dismissable</i> to false disables this behavior.
|
||||
Additionally enabling <i>showCloseIcon</i> property displays a close icon at the top right corner to close the panel.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<OverlayPanel ref="op" :showCloseIcon="true" :dismissable="true">
|
||||
<img src="demo/images/nature/nature1.jpg" alt="Nature Image">
|
||||
</OverlayPanel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -150,8 +158,8 @@ toggle(event) {
|
|||
<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>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Button type="button" icon="pi pi-search" :label="selectedProduct ? selectedProduct.name : 'Select a Product'" @click="toggle" aria:haspopup="true" aria-controls="overlay_panel" />
|
||||
|
||||
<OverlayPanel ref="op" appendTo="body" :showCloseIcon="true" id="overlay_panel" style="width: 450px">
|
||||
|
@ -170,9 +178,10 @@ toggle(event) {
|
|||
</DataTable>
|
||||
</OverlayPanel>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -202,7 +211,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,39 +3,51 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Paginator from 'primevue/paginator';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p><i>rows</i> and <i>totalRecords</i> are the required properties of the Paginator.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :rows="10" :totalRecords="totalItemsCount"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Start Index</h5>
|
||||
<p><i>first</i> property defines the index of the first item displayed by the paginator.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :first="offset" :rows="10" :totalRecords="totalItemsCount"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Use the sync operator to enable two-way binding, this is useful in cases where you need to programmatically control the paginator.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :first.sync="offset" :rows="10" :totalRecords="totalItemsCount"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Rows Per Page</h5>
|
||||
<p>Number of items per page can be changed by the user using a dropdown with the <i>rowsPerPageOptions</i> property which accepts an array of possible values.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :first.sync="offset" :rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>As <i>rows</i> also change when the dropdown changes, use the optional sync operator if you need two-way binding.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :first.sync="offset" :rows.sync="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Template</h5>
|
||||
<p>Paginator elements can be customized using the template property using the predefined keys, default value is
|
||||
|
@ -69,8 +81,8 @@ import Paginator from 'primevue/paginator';
|
|||
<p>There are two templates available named "left" and "right" to add custom content to these locations. Both templates get
|
||||
a state object as a slot property to provide the current page, first index and the rows.
|
||||
</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<Paginator :first.sync="offset" :rows="10" :totalRecords="totalItemsCount">
|
||||
<template #left="slotProps">
|
||||
Page: {{slotProps.state.page}}
|
||||
|
@ -82,22 +94,26 @@ import Paginator from 'primevue/paginator';
|
|||
</template>
|
||||
</Paginator>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Page Change Event</h5>
|
||||
<p>Paginator provides only one event called <i>page</i> that passes all the information about the change event.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Paginator :rows="10" :totalRecords="totalItemsCount" @page="onPage($event)"></Paginator>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
onPage(event) {
|
||||
//event.page: New page number
|
||||
//event.first: Index of first record
|
||||
//event.rows: Number of rows to display in new page
|
||||
//event.pageCount: Total number of pages
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -244,7 +260,8 @@ onPage(event) {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/showcase/paginator" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h3>Basic</h3>
|
||||
<Paginator :rows="10" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
|
||||
|
@ -262,9 +279,11 @@ onPage(event) {
|
|||
<div class="image-gallery">
|
||||
<img :src="'demo/images/nature/' + image + '.jpg'" />
|
||||
</div>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -284,9 +303,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
.p-button.p-button-icon-only {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
@ -295,7 +316,8 @@ export default {
|
|||
text-align: center;
|
||||
padding: 1rem;
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,63 +3,76 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Panel from 'primevue/panel';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Panel is a container component that accepts content as its children.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Panel header="Header">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
|
||||
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Header</h5>
|
||||
<p>Header of the panel is either defined with the <i>header</i> property or the header template.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Panel>
|
||||
<template #header>
|
||||
Header Content
|
||||
</template>
|
||||
Content
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Toggleable</h5>
|
||||
<p>Content of the panel can be expanded and collapsed using <i>toggleable</i> option.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Panel header="Header" :toggleable="true">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
|
||||
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Panel header="Header Text" :toggleable="true" :collapsed="true">
|
||||
Content
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Use the sync operator to enable two-way binding.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
|
||||
<Panel header="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
|
||||
Content
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Custom Icons</h5>
|
||||
<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-header-icon</i>
|
||||
class to your icons.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<h5>Advanced</h5>
|
||||
<Panel header="Header">
|
||||
<template #icons>
|
||||
|
@ -69,7 +82,8 @@ import Panel from 'primevue/panel';
|
|||
<Menu id="config_menu" ref="menu" :model="items" :popup="true" />
|
||||
</template>
|
||||
</Panel>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -176,8 +190,8 @@ import Panel from 'primevue/panel';
|
|||
<span>View on GitHub</span>
|
||||
</a>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h5>Regular</h5>
|
||||
<Panel header="Header">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
|
@ -200,9 +214,10 @@ import Panel from 'primevue/panel';
|
|||
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</Panel>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -249,7 +264,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,20 +3,25 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PanelMenu from 'primevue/panelmenu';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>MenuModel</h5>
|
||||
<p>PanelMenu uses the common MenuModel API to define the items, visit <router-link to="/menumodel">MenuModel API</router-link> for details.</p>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>PanelMenu requires a collection of menuitems as its model.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<PanelMenu :model="items" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -140,7 +145,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -220,13 +226,14 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/panelmenu" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<PanelMenu :model="items" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -350,7 +357,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,15 +3,19 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import Password from 'primevue/password';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>A model can be bound using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Password v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Customization</h5>
|
||||
<p>Password components uses regular expressions for middle and strong passwords with the following defaults.</p>
|
||||
|
@ -138,11 +142,14 @@ import Password from 'primevue/password';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/password" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<Password v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -150,7 +157,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,15 +3,17 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import PickList from 'primevue/picklist';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>PickList requires a multidimensional array as its value bound with the v-model directive and a template for its content
|
||||
that gets the <i>item</i> instance and the <i>index</i> via slotProps.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<PickList v-model="cars" dataKey="vin">
|
||||
<template #item="slotProps">
|
||||
<div class="p-caritem">
|
||||
|
@ -24,12 +26,12 @@ import PickList from 'primevue/picklist';
|
|||
</template>
|
||||
</PickList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Templates</h5>
|
||||
<p>In addition to the mandatory "item" template, picklist provides "sourceHeader" and "targetHeader" slots as optional templates.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<PickList v-model="cars" dataKey="vin">
|
||||
<template #sourceHeader>
|
||||
Available
|
||||
|
@ -48,15 +50,15 @@ import PickList from 'primevue/picklist';
|
|||
</template>
|
||||
</PickList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Selection</h5>
|
||||
<p>In case you need to access the selected items in the list, define a binding to the <i>selection</i> property with the v-model directive so that
|
||||
it gets updated when the user makes a selection. Since it is two-way binding enabled, your changes to the selection will be reflected as well. Note that
|
||||
this is optional and only necessary when you need to access the selection.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<PickList v-model="cars" dataKey="vin" v-model:selection="selection">
|
||||
<template #item="slotProps">
|
||||
<div class="p-caritem">
|
||||
|
@ -69,7 +71,7 @@ import PickList from 'primevue/picklist';
|
|||
</template>
|
||||
</PickList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>DataKey</h5>
|
||||
<p>It is recommended to provide the name of the field that uniquely identifies the a record in the data via the <i>dataKey</i> property for better performance.</p>
|
||||
|
@ -227,8 +229,8 @@ import PickList from 'primevue/picklist';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/picklist" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<PickList v-model="products" listStyle="height:342px" dataKey="id">
|
||||
<template #sourceHeader>
|
||||
Available
|
||||
|
@ -254,9 +256,10 @@ import PickList from 'primevue/picklist';
|
|||
</template>
|
||||
</PickList>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProductService from '../../service/ProductService';
|
||||
|
||||
export default {
|
||||
|
@ -273,9 +276,11 @@ export default {
|
|||
this.productService.getProductsSmall().then(data => this.products = [data, []]);
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
product-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -324,7 +329,8 @@ product-item {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -8,20 +8,25 @@
|
|||
<h5>Download</h5>
|
||||
<p>PrimeFlex is available at <a href="https://www.npmjs.com/package/primeflex">npm</a>, if you have an existing application run the following commands to install it.</p>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
npm install primeflex --save
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Import</h5>
|
||||
<p>Next step is adding the primeflex.css to your application to include all utilities. If you prefer to pick the utilities, move to next step instead.</p>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
import 'primeflex/primeflex.css';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>PrimeFlex is a lightweight library still if you have an application such as one based on vue-cli
|
||||
that is able to import scss then you will be able to pick the utilities you need to make the app bundle even smaller.</p>
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
import 'primeflex/src/_variables.scss';
|
||||
import 'primeflex/src/_grid.scss';
|
||||
import 'primeflex/src/_formlayout.scss';
|
||||
|
@ -30,7 +35,8 @@ import 'primeflex/src/_text.scss';
|
|||
import 'primeflex/src/flexbox/_flexbox.scss';
|
||||
import 'primeflex/src/_spacing.scss';
|
||||
import 'primeflex/src/_elevation.scss';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Variables</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -97,14 +103,17 @@ import 'primeflex/src/_elevation.scss';
|
|||
</p>
|
||||
|
||||
<p><b>_overrides.scss</b></p>
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
$sm:640px;
|
||||
$md:720px;
|
||||
$lg:960px;
|
||||
$xl:1080px;
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
</code></pre>
|
||||
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
import './assets/_overrides.scss';
|
||||
import 'primeflex/src/_variables.css';
|
||||
import 'primeflex/src/_grid.css';
|
||||
|
@ -114,7 +123,8 @@ import 'primeflex/src/_text.css';
|
|||
import 'primeflex/src/flexbox/_flexbox.css';
|
||||
import 'primeflex/src/_spacing.css';
|
||||
import 'primeflex/src/_elevation.css';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
|
@ -3,37 +3,45 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProgressBar from 'primevue/progressbar';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>ProgressBar has two modes; "determinate" (default) and "indeterminate". In determinate mode, a value between 0 and 100 is required to display the progress.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<ProgressBar :value="value" />
|
||||
</CodeHighlight>
|
||||
<CodeHighlight lang="js">
|
||||
|
||||
</code></pre>
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
data() {
|
||||
return {
|
||||
value: 0
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>Indeterminate is simplly enabled using <i>mode</i> property.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<ProgressBar mode="indeterminate"/>
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Slot</h5>
|
||||
<p>A custom label can be placed inside the progress bar via the default slot.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<ProgressBar :value="value">
|
||||
Percent Complete: {{value}}%
|
||||
</ProgressBar>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<div class="doc-tablewrapper">
|
||||
|
@ -112,8 +120,8 @@ data() {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/prograssbar" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Dynamic</h3>
|
||||
<ProgressBar :value="value1" />
|
||||
|
||||
|
@ -123,9 +131,10 @@ data() {
|
|||
<h3>Indeterminate</h3>
|
||||
<ProgressBar mode="indeterminate" style="height: .5em" />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -156,7 +165,8 @@ export default {
|
|||
this.endProgress();
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,21 +3,24 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import ProgressSpinner from 'primevue/progressspinner';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>ProgressSpinner is defined using ProgressSpinner element.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<ProgressSpinner />
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<h5>Colors</h5>
|
||||
<p>Colors of the spinner can be changed by overriding the keyframes animation.</p>
|
||||
<CodeHighlight lang="css">
|
||||
<pre v-code.css>
|
||||
<code>
|
||||
@keyframes ui-progress-spinner-color {
|
||||
100%,
|
||||
0% {
|
||||
|
@ -34,7 +37,8 @@ import ProgressSpinner from 'primevue/progressspinner';
|
|||
stroke: #ffa700;
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
||||
|
@ -106,15 +110,15 @@ import ProgressSpinner from 'primevue/progressspinner';
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/progressspinner" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic</h3>
|
||||
<ProgressSpinner />
|
||||
|
||||
<h3>Custom</h3>
|
||||
<ProgressSpinner style="width:50px;height:50px" strokeWidth="8" fill="#EEEEEE" animationDuration=".5s"/>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h5>Import</h5>
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
import RadioButton from 'primevue/radiobutton';
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Getting Started</h5>
|
||||
<p>Two-way value binding is defined using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<pre v-code>
|
||||
<code>
|
||||
<RadioButton name="city" value="Chicago" v-model="city" />
|
||||
<RadioButton name="city" value="Los Angeles" v-model="city" />
|
||||
</CodeHighlight>
|
||||
<CodeHighlight lang="js">
|
||||
|
||||
</code></pre>
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -21,9 +26,11 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
<p>As model is two-way binding enabled, giving a default value to the model is enough to display a radio button as checked by default.</p>
|
||||
<CodeHighlight lang="js">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -31,7 +38,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h5>Properties</h5>
|
||||
<p>Any property such as name and autofocus are passed to the underlying input element. Following is the additional property to configure the component.</p>
|
||||
|
@ -104,8 +112,8 @@ export default {
|
|||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/radiobutton" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<pre v-code>
|
||||
<code><template v-pre>
|
||||
<h3>Basic</h3>
|
||||
<div class="p-field-radiobutton">
|
||||
<RadioButton id="city1" name="city" value="Chicago" v-model="city" />
|
||||
|
@ -130,9 +138,10 @@ export default {
|
|||
<label :for="category.key">{{category.name}}</label>
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
</code></pre>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
<pre v-code.script>
|
||||
<code>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -145,7 +154,8 @@ export default {
|
|||
this.selectedCategory = this.categories[1];
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
</code></pre>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue