Fixed spacing in firefox

pull/938/head
Cagatay Civici 2021-02-03 13:10:30 +03:00
parent c30f84b063
commit 4515bbd99b
149 changed files with 929 additions and 1858 deletions

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
@ -12,8 +11,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Getting Started</h5>
<p>Accordion element consists of one or more AccordionTab elements. Title of the tab is defined using header attribute.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion&gt;
&lt;AccordionTab header="Header I"&gt;
Content
@ -30,8 +28,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Active</h5>
<p>Visibility of the content is specified with the <i>activeIndex</i> property that supports one or two-way binding.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion :activeIndex="0"&gt;
&lt;AccordionTab header="Header I"&gt;
Content
@ -47,8 +44,7 @@ import AccordionTab from 'primevue/accordiontab';
</code></pre>
<p>Two-way binding requires v-model.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion v-model:activeIndex="activeIndex"&gt;
&lt;AccordionTab header="Header I"&gt;
Content
@ -66,8 +62,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Multiple</h5>
<p>By default only one tab at a time can be active, enabling multiple property changes this behavior to allow multiple
tabs be active at the same time.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion :multiple="true"&gt;
&lt;AccordionTab header="Header I"&gt;
Content
@ -84,8 +79,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Disabled</h5>
<p>A tab can be disabled by setting the <i>disabled</i> property to true.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion&gt;
&lt;AccordionTab header="Header I"&gt;
Content
@ -102,8 +96,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Custom Content at Headers</h5>
<p>Custom content for the title section of a panel is defined using the header template.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Accordion&gt;
&lt;AccordionTab&gt;
&lt;template #header&gt;
@ -132,8 +125,7 @@ import AccordionTab from 'primevue/accordiontab';
<h5>Programmatic Control</h5>
<p>Tabs can be controlled programmatically using <i>activeIndex</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button @click="active = 0" class="p-button-text" label="Activate 1st" /&gt;
&lt;Button @click="active = 1" class="p-button-text" label="Activate 2nd" /&gt;
&lt;Button @click="active = 2" class="p-button-text" label="Activate 3rd" /&gt;
@ -152,8 +144,7 @@ import AccordionTab from 'primevue/accordiontab';
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -166,8 +157,7 @@ export default {
<h5>Dynamic Tabs</h5>
<p>Tabs can be generated dynamically using the standard <i>v-for</i> directive.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Accordion&gt;
&lt;AccordionTab v-for="tab in tabs" :key="tab.title" :header="tab.title"&gt;
&lt;p&gt;{{tab.content}}&lt;/p&gt;
@ -176,8 +166,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -322,8 +311,7 @@ export default {
</a>
<LiveEditor name="AccordionDemo" :sources="sources" :components="['AccordionTab', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Default&lt;/h5&gt;
&lt;Accordion :activeIndex="0"&gt;
&lt;AccordionTab header="Header I"&gt;
@ -430,8 +418,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -462,8 +449,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.accordion-custom {
i, span {
vertical-align: middle;

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import AutoComplete from 'primevue/autocomplete';
</code></pre>
@ -12,13 +11,11 @@ import AutoComplete from 'primevue/autocomplete';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;AutoComplete v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountry($event)" field="name" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -44,16 +41,14 @@ export default {
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>
<pre v-code>
<code>
<pre v-code><code>
&lt;AutoComplete v-model="brand" :dropdown="true" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountriesMultiple" @complete="searchCountryMultiple($event)" field="name" /&gt;
</code></pre>
@ -62,16 +57,14 @@ export default {
<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 &#123;name:"United States",code:"USA"&#125;.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;AutoComplete field="label" v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountryBasic($event)" /&gt;
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;AutoComplete v-model="brand" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" :dropdown="true"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :alt="slotProps.item" :src="'demo/images/car/' + slotProps.item + '.png'" /&gt;
@ -261,8 +254,7 @@ export default {
</a>
<LiveEditor name="AutoCompleteDemo" :sources="sources" service="CountryService" data="countries" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;AutoComplete v-model="selectedCountry1" :suggestions="filteredCountries" @complete="searchCountry($event)" field="name" /&gt;
@ -283,8 +275,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CountryService from '../../service/CountryService';
export default {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Avatar from 'primevue/avatar';
import AvatarGroup from 'primevue/avatargroup';
@ -12,8 +11,7 @@ import AvatarGroup from 'primevue/avatargroup';
<h5>Getting Started</h5>
<p>Avatar has three built-in display modes; "label", "icon" and "image".</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Avatar label="P" /&gt;
&lt;Avatar icon="pi pi-search" /&gt;
&lt;Avatar image="user.png" /&gt;
@ -22,16 +20,14 @@ import AvatarGroup from 'primevue/avatargroup';
<h5>Sizes</h5>
<p><i>size</i> property defines the size of the Avatar with "large" and "xlarge" as possible values.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Avatar label="P" size="large"/&gt;
</code></pre>
<h5>AvatarGroup</h5>
<p>A set of Avatars can be displayed together using the <i>AvatarGroup</i> component.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;AvatarGroup&gt;
&lt;Avatar label="P" /&gt;
&lt;Avatar icon="pi pi-search" /&gt;
@ -42,24 +38,21 @@ import AvatarGroup from 'primevue/avatargroup';
<h5>Shape</h5>
<p>Avatar comes in two different styles specified with the <i>shape</i> property, "square" is the default and "circle" is the alternative.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Avatar label="P" shape="circle"/&gt;
</code></pre>
<h5>Badge</h5>
<p>A badge can be added to an Avatar with the <router-link to="/badge">Badge</router-link> directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Avatar image="user.png" size="xlarge" v-badge.danger="4" /&gt;
</code></pre>
<h5>Templating</h5>
<p>Content can easily be customized with the default slot instead of using the built-in modes.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Avatar&gt;
Content
&lt;/Avatar&gt;
@ -188,8 +181,7 @@ import AvatarGroup from 'primevue/avatargroup';
</a>
<LiveEditor name="AvatarDemo" :sources="sources" :directives="['Badge']" :components="['AvatarGroup']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-12 p-md-4"&gt;
&lt;div class="card"&gt;

View File

@ -6,29 +6,25 @@
<p>Badge can either be used as a standalone component or as a directive.</p>
<h6>Component</h6>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Badge from 'primevue/badge';
</code></pre>
<p>Content of the badge is specified using the <i>value</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Badge value="2"&gt;&lt;/Badge&gt;
</code></pre>
<h6>Directive</h6>
<pre v-code.script>
<code>
<pre v-code.script><code>
import BadgeDirective from 'primevue/badgedirective';
</code></pre>
<p>When used as a directive, badge needs to be configured at the application with a name of your choice.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import BadgeDirective from 'primevue/badgedirective';
Vue.directive('badge', BadgeDirective);
@ -36,8 +32,7 @@ Vue.directive('badge', BadgeDirective);
</code></pre>
<p>Next step is attaching it to an element.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;i class="pi pi-bell" v-badge="2"&gt;&lt;/i&gt;
</code></pre>
@ -53,8 +48,7 @@ Vue.directive('badge', BadgeDirective);
<li>danger</li>
</ul>
<pre v-code>
<code>
<pre v-code><code>
&lt;Badge value="2" severity="success"&gt;&lt;/Badge&gt;
&lt;i class="pi pi-bell" v-badge.success="2"&gt;&lt;/i&gt;
@ -64,8 +58,7 @@ Vue.directive('badge', BadgeDirective);
<h5>Button Badges</h5>
<p>Buttons provide integrated badge support with the <i>badge</i> and <i>badgeClass</i> properties.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button type="button" label="Emails" badge="8" /&gt;
&lt;Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger" /&gt;
@ -74,8 +67,7 @@ Vue.directive('badge', BadgeDirective);
<h5>Sizes</h5>
<p>Badge sizes are adjusted with the <i>size</i> property that accepts "large" and "xlarge" as the possible alternatives to the default size. Currently
sizes only apply to component mode.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Badge value="2"&gt;&lt;/Badge&gt;
&lt;Badge value="4" size="large" severity="warning"&gt;&lt;/Badge&gt;
&lt;Badge value="6" size="xlarge" severity="success"&gt;&lt;/Badge&gt;
@ -83,8 +75,7 @@ Vue.directive('badge', BadgeDirective);
</code></pre>
<p>In addition, when placed inside another element, badge sizes can also derive their size from their parent.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;h1&gt;Heading 1 &lt;Badge value="New"&gt;&lt;/Badge&gt;&lt;/h1&gt;
&lt;h2&gt;Heading 2 &lt;Badge value="New"&gt;&lt;/Badge&gt;&lt;/h2&gt;
@ -187,8 +178,7 @@ Vue.directive('badge', BadgeDirective);
</a>
<LiveEditor name="BadgeDemo" :sources="sources" :directives="['Badge']" :components="['Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Numbers&lt;/h5&gt;
&lt;Badge value="2" class="p-mr-2"&gt;&lt;/Badge&gt;
&lt;Badge value="8" severity="success" class="p-mr-2"&gt;&lt;/Badge&gt;

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import BlockUI from 'primevue/blockui';
</code></pre>
@ -13,8 +12,7 @@ import BlockUI from 'primevue/blockui';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;BlockUI :blocked="blockedPanel"&gt;
&lt;Panel header="Header"&gt;
Panel Content
@ -23,8 +21,7 @@ import BlockUI from 'primevue/blockui';
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -46,8 +43,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;BlockUI :blocked="blockedDocument" :fullScreen="true"&gt;&lt;/BlockUI&gt;
</code></pre>
@ -152,8 +148,7 @@ export default {
</a>
<LiveEditor name="BlockUIDemo" :sources="sources" :components="['Button', 'Panel']" />
</div>
<pre v-code>
<code>
<pre v-code><code>
&lt;h3&gt;Document&lt;/h3&gt;
&lt;BlockUI :blocked="blockedDocument" :fullScreen="true"&gt;&lt;/BlockUI&gt;
@ -174,8 +169,7 @@ export default {
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Breadcrumb from 'primevue/breadcrumb';
</code></pre>
@ -14,14 +13,12 @@ import Breadcrumb from 'primevue/breadcrumb';
<h5>Getting Started</h5>
<p>Breadcrumb requires a collection of menuitems as its model and a home item.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Breadcrumb :home="home" :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -110,14 +107,12 @@ export default {
</a>
<LiveEditor name="BreadcrumbDemo" :sources="sources" :router="true" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Breadcrumb :home="home" :model="items" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,40 +3,35 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Button from 'primevue/button';
</code></pre>
<h5>Getting Started</h5>
<p>Button is created using the Button element.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button /&gt;
</code></pre>
<h5>Label</h5>
<p>Text of the button is defined using the <i>label</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Submit" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Submit" icon="pi pi-check" iconPos="right" /&gt;
</code></pre>
<h5>Events</h5>
<p>Events are defined with the standard notation.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Submit" @click="handleClick($event)"/&gt;
</code></pre>
@ -53,8 +48,7 @@ import Button from 'primevue/button';
<li>.p-button-danger</li>
</ul>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Primary" /&gt;
&lt;Button label="Secondary" class="p-button-secondary" /&gt;
&lt;Button label="Success" class="p-button-success" /&gt;
@ -68,8 +62,7 @@ import Button from 'primevue/button';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Submit" class="p-button-text" /&gt;
&lt;Button icon="pi pi-check" class="p-button-text" /&gt;
&lt;Button label="Cancel" icon="pi pi-times" class="p-button-text" /&gt;
@ -79,24 +72,21 @@ import Button from 'primevue/button';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Primary" class="p-button-raised p-button-rounded" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Primary" class="p-button-outlined" /&gt;
</code></pre>
<h5>Link Buttons</h5>
<p>Use "p-button-link" class to render the button as a link.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Link" class="p-button-link" /&gt;
</code></pre>
@ -104,8 +94,7 @@ import Button from 'primevue/button';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button type="button" label="Emails" badge="8" /&gt;
&lt;Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-info" /&gt;
@ -113,8 +102,7 @@ import Button from 'primevue/button';
<h5>ButtonSet</h5>
<p>Wrapping the buttons in a container having a <i>.p-buttonset</i> class, groups the buttons side to side.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;span class="p-buttonset"&gt;
&lt;Button label="Save" icon="pi pi-check" /&gt;
&lt;Button label="Delete" icon="pi pi-trash" /&gt;
@ -126,8 +114,7 @@ import Button from 'primevue/button';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button label="Small" icon="pi pi-check" class="p-button-sm" /&gt;
&lt;Button label="Normal" icon="pi pi-check" class="p-button" /&gt;
&lt;Button label="Large" icon="pi pi-check" class="p-button-lg" /&gt;
@ -136,8 +123,7 @@ import Button from 'primevue/button';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button&gt;
Custom Content
&lt;/Button&gt;
@ -237,8 +223,7 @@ import Button from 'primevue/button';
</a>
<LiveEditor name="ButtonDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;Button label="Submit" /&gt;
&lt;Button label="Disabled" disabled="disabled" /&gt;
@ -353,8 +338,7 @@ import Button from 'primevue/button';
</template>
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
button {
margin-right: .5rem;
}

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Calendar from 'primevue/calendar';
</code></pre>
@ -12,14 +11,12 @@ import Calendar from 'primevue/calendar';
<h5>Getting Started</h5>
<p>Two-way value binding is defined using the standard v-model directive referencing to a Date property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -32,8 +29,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :inline="true" /&gt;
</code></pre>
@ -44,8 +40,7 @@ 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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" selectionMode="single || multiple || range" /&gt;
</code></pre>
@ -53,8 +48,7 @@ export default {
<h5>DateFormat</h5>
<p>Default date format is mm/dd/yy, to customize this use <i>dateFormat</i> property or define it at <router-link to="/locale">PrimeVue Locale</router-link> globally. Note that standalone property overrides the value in locale settings.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" dateFormat="dd.mm.yy" /&gt;
</code></pre>
@ -84,8 +78,7 @@ 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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :showTime="true" /&gt;
&lt;Calendar v-model="value" :showTime="true" hourFormat="12" /&gt;
&lt;Calendar v-model="value" :showTime="true" :timeOnly="true" /&gt;
@ -95,31 +88,27 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :minDate="minDateValue" maxDate="maxDateValue" /&gt;
</code></pre>
<p>To disable specific dates or days, restrict selectable dates use <i>disabledDates</i> and/or <i>disabledDays</i> options.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :disabledDates="invalidDates" :disabledDays="[0,6]" /&gt;
</code></pre>
<h5>Button Bar</h5>
<p>Button bar displays today and clear buttons and enabled using <i>showButtonBar</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :showButtonBar="true" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :numberOfMonths="3" /&gt;
</code></pre>
@ -130,8 +119,7 @@ export default {
<h5>Custom Content</h5>
<p>Calendar UI accepts custom content using header and footer templates.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value"&gt;
&lt;template #header&gt;Header Content&lt;/template&gt;
&lt;template #footer&gt;Footer Content&lt;/template&gt;
@ -143,8 +131,7 @@ export default {
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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Calendar v-model="value"&gt;
&lt;template #date="slotProps"&gt;
&lt;strong v-if="slotProps.date.day &gt; 10 && slotProps.date.day &lt; 15" class="special-day"&gt;{{slotProps.date.day}}&lt;/strong&gt;
@ -154,8 +141,7 @@ export default {
</template>
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.special-day {
text-decoration: line-through;
}
@ -164,16 +150,14 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" view="month" dateFormat="mm/yy" :yearNavigator="true" yearRange="2000:2030" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Calendar v-model="value" :touchUI="true" /&gt;
</code></pre>
@ -552,8 +536,7 @@ export default {
</a>
<LiveEditor name="CalendarDemo" :sources="sources" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Popup&lt;/h5&gt;
&lt;div class=" p-fluid p-grid p-formgrid"&gt;
&lt;div class="p-field p-col-12 p-md-4"&gt;
@ -628,8 +611,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
created() {
let today = new Date();
@ -677,8 +659,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.special-day {
text-decoration: line-through;
}

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Card from 'primevue/card';
</code></pre>
<h5>Getting Started</h5>
<p>Card provides <i>header</i>, <i>title</i>, <i>subtitle</i>, <i>content</i> and <i>footer</i> as the named templates to place content.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Card&gt;
&lt;template #header&gt;
&lt;img alt="user header" src="demo/images/usercard.png"&gt;
@ -78,8 +76,7 @@ import Card from 'primevue/card';
</a>
<LiveEditor name="CardDemo" :sources="sources" :components="['Button']"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Card style="width: 25rem; margin-bottom: 2em"&gt;
&lt;template #title&gt;
Simple Card

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Carousel from 'primevue/carousel';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Carousel :value="cars"&gt;
&lt;template #item="slotProps"&gt;
&lt;/template&gt;
@ -22,8 +20,7 @@ import Carousel from 'primevue/carousel';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Carousel :value="cars" :numVisible="3" :numScroll="1"&gt;
&lt;template #item="slotProps"&gt;
&lt;/template&gt;
@ -34,8 +31,7 @@ import Carousel from 'primevue/carousel';
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Carousel :value="cars" :numVisible="4" :numScroll="3" :responsiveOptions="responsiveOptions"&gt;
&lt;template #header&gt;
&lt;h2&gt;Basic&lt;/h2&gt;
@ -62,8 +58,7 @@ import Carousel from 'primevue/carousel';
&lt;/Carousel&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
responsiveOptions: [
@ -91,8 +86,7 @@ data() {
<h5>Header and Footer</h5>
<p>Custom content projection is available using the <i>header</i> and <i>footer</i> templates.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Carousel :value="cars" :numVisible="3" :numScroll="1" :responsiveOptions="responsiveOptions"&gt;
&lt;template #header&gt;
&lt;h2&gt;Custom Header&lt;/h2&gt;
@ -109,8 +103,7 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Carousel :value="cars" :numVisible="1" :numScroll="1" orientation="vertical" verticalViewPortHeight="330px" :responsiveOptions="responsiveOptions"&gt;
&lt;template #item="slotProps"&gt;
Content
@ -121,8 +114,7 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Carousel :value="cars" :numVisible="3" :numScroll="1" :circular="true" :autoplayInterval="3000"&gt;
&lt;template #header&gt;
&lt;h2&gt;Circular, AutoPlay&lt;/h2&gt;
@ -280,8 +272,7 @@ data() {
</a>
<LiveEditor name="CarouselDemo" :sources="sources" service="ProductService" data="products-small" :components="['Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;Carousel :value="products" :numVisible="3" :numScroll="3" :responsiveOptions="responsiveOptions"&gt;
&lt;template #header&gt;
@ -365,8 +356,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -403,8 +393,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.product-item {
.product-item-content {
border: 1px solid var(--surface-d);

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CascadeSelect from 'primevue/cascadeselect';
</code></pre>
@ -14,15 +13,13 @@ import CascadeSelect from 'primevue/cascadeselect';
is used for the text of a category and <i>optionGroupChildren</i> is to define the children of the category. Note that order of the <i>optionGroupChildren</i>
matters and it should correspond to the data hierarchy.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;CascadeSelect v-model="selectedCity" :options="countries" optionLabel="cname" optionGroupLabel="name"
:optionGroupChildren="['states', 'cities']" style="minWidth: 14rem" &gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
data() &#123;
return &#123;
@ -112,8 +109,7 @@ data() {
<h5>Templating</h5>
<p>Content of an item can be customized with the <i>option</i> template.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;CascadeSelect v-model="selectedCity" :options="countries" optionLabel="cname" optionGroupLabel="name"
:optionGroupChildren="['states', 'cities']" style="minWidth: 14rem"&gt;
&lt;template #option="slotProps"&gt;
@ -324,8 +320,7 @@ data() {
</a>
<LiveEditor name="CascadeSelectDemo" :sources="sources" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;CascadeSelect v-model="selectedCity1" :options="countries" optionLabel="cname" optionGroupLabel="name"
:optionGroupChildren="['states', 'cities']" style="minWidth: 14rem" placeholder="Select a City" /&gt;
@ -345,8 +340,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default &#123;
data() &#123;
return &#123;

View File

@ -5,8 +5,7 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Vertical&lt;/h3&gt;
&lt;Chart type="bar" :data="basicData" /&gt;
@ -21,8 +20,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,15 +5,13 @@
<h5>Getting Started</h5>
<p>To begin with, charts.js package needs to be installed in your project.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
npm install chart.js --save
</code></pre>
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Chart from 'primevue/chart';
</code></pre>
@ -23,14 +21,12 @@ import Chart from 'primevue/chart';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chart type="bar" :data="basicData" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -58,14 +54,12 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chart type="line" :data="data" :options="options" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
options: {
responsive: true,
hoverMode: 'index',

View File

@ -5,14 +5,12 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chart type="bar" :data="chartData" :options="chartOptions"/&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,14 +5,12 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chart type="doughnut" :data="chartData" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,8 +5,7 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Basic&lt;/h3&gt;
&lt;Chart type="line" :data="basicData" /&gt;
@ -18,8 +17,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,14 +5,12 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chart type="pie" :data="chartData" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,14 +5,12 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chart type="polarArea" :data="chartData" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -5,14 +5,12 @@
<div class="p-d-flex">
<LiveEditor name="ChartDemo" :sources="sources" class="p-ml-auto" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chart type="radar" :data="chartData" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,24 +3,21 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Checkbox from 'primevue/checkbox';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Checkbox v-model="checked" :binary="true" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Checkbox name="city" value="Chicago" v-model="cities" /&gt;
&lt;Checkbox name="city" value="Los Angeles" v-model="cities" /&gt;
&lt;Checkbox name="city" value="New York" v-model="cities" /&gt;
@ -28,8 +25,7 @@ import Checkbox from 'primevue/checkbox';
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -119,8 +115,7 @@ export default {
</a>
<LiveEditor name="CheckboxDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Basic&lt;/h3&gt;
&lt;div class="p-field-checkbox"&gt;
&lt;Checkbox id="binary" v-model="checked" :binary="true" /&gt;
@ -153,8 +148,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Chip from 'primevue/chip';
</code></pre>
<h5>Getting Started</h5>
<p>Chip can display labels, icons and images.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chip label="Text Only" /&gt;
&lt;Chip label="Text with icon" icon="pi pi-check" /&gt;
&lt;Chip label="Text with image" image="user.png" /&gt;
@ -22,16 +20,14 @@ import Chip from 'primevue/chip';
<h5>Removable</h5>
<p>Setting <i>removable</i> property displays an icon to close the chip, the optional <i>remove</i>
event is available to get notified when a chip is hidden.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chip label="Text" removable /&gt;
</code></pre>
<h5>Templating</h5>
<p>Content can easily be customized with the default slot instead of using the built-in modes.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chip&gt;
Content
&lt;/Chip&gt;
@ -147,8 +143,7 @@ import Chip from 'primevue/chip';
</a>
<LiveEditor name="ChipDemo" :sources="sources" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;div class="p-d-flex p-ai-center"&gt;
&lt;Chip label="Action" class="p-mr-2" /&gt;

View File

@ -3,24 +3,21 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Chips from 'primevue/chips';
</code></pre>
<h5>Getting Started</h5>
<p>An array as the value can be bound using the standard v-model directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Chips v-model="value" /&gt;
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Chips v-model="value"&gt;
&lt;template #chip="slotProps"&gt;
&lt;div&gt;
@ -153,8 +150,7 @@ import Chips from 'primevue/chips';
</a>
<LiveEditor name="ChipsDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;Chips v-model="value1" /&gt;
@ -173,8 +169,7 @@ import Chips from 'primevue/chips';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ColorPicker from 'primevue/colorpicker';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;ColorPicker v-model="color" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -31,8 +28,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;ColorPicker v-model="color" :inline="true" /&gt;
</code></pre>
@ -174,8 +170,7 @@ export default {
</a>
<LiveEditor name="ColorPickerDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Inline&lt;/h3&gt;
&lt;ColorPicker v-model="color1" :inline="true" /&gt;
@ -184,8 +179,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -4,8 +4,7 @@
<TabPanel header="Documentation">
<h5>Mitt EventBus</h5>
<p>ConfirmDialog requires <a href="https://www.npmjs.com/package/mitt">Mitt</a>, a tiny 200b EventBus implementation.</p>
<pre v-code>
<code>
<pre v-code><code>
npm install mitt --save
</code></pre>
@ -13,8 +12,7 @@ npm install mitt --save
<h5>ConfirmationService</h5>
<p>ConfirmDialog is controlled via the <i>ConfirmationService</i> that needs to be installed globally before the application
instance is created.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import {createApp} from 'vue';
import ConfirmationService from 'primevue/confirmationservice';
@ -24,8 +22,7 @@ app.use(ConfirmationService);
</code></pre>
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ConfirmDialog from 'primevue/confirmdialog';
</code></pre>
@ -33,15 +30,13 @@ import ConfirmDialog from 'primevue/confirmdialog';
<h5>Getting Started</h5>
<p>ConfirmDialog is displayed by calling the <i>require</i> method of the <i>$confirm</i> instance by passing the options to customize the Dialog. Suggested location of the Dialog is the main application component
where it can be shared by any component within the application.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;ConfirmDialog&gt;&lt;/ConfirmDialog&gt;
&lt;Button @click="delete()" icon="pi pi-check" label="Confirm"&gt;&lt;/Button&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
delete() {
@ -64,8 +59,7 @@ export default {
<h5>Composition API</h5>
<p>The service can be injected with the <i>useConfirm</i> function.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import { defineComponent } from "vue";
import { useConfirm } from "primevue/useconfirm";
@ -90,8 +84,7 @@ export default defineComponent({
<h5>Close Confirmation</h5>
<p>The dialog can also be hidden programmatically using the <i>close</i> method.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
discard() {
@ -250,8 +243,7 @@ export default {
</a>
<LiveEditor name="ConfirmDialogDemo" :sources="sources" :confirmationService="true" :toastService="true" :components="['Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;ConfirmDialog&gt;&lt;/ConfirmDialog&gt;
&lt;ConfirmDialog group="positionDialog"&gt;&lt;/ConfirmDialog&gt;
@ -281,8 +273,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
confirm1() {

View File

@ -4,8 +4,7 @@
<TabPanel header="Documentation">
<h5>Mitt EventBus</h5>
<p>ConfirmPopup requires <a href="https://www.npmjs.com/package/mitt">Mitt</a>, a tiny 200b EventBus implementation.</p>
<pre v-code>
<code>
<pre v-code><code>
npm install mitt --save
</code></pre>
@ -13,8 +12,7 @@ npm install mitt --save
<h5>ConfirmationService</h5>
<p>ConfirmPopup is controlled via the <i>ConfirmationService</i> that needs to be installed globally before the application
instance is created.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import {createApp} from 'vue';
import ConfirmationService from 'primevue/confirmationservice';
@ -24,8 +22,7 @@ app.use(ConfirmationService);
</code></pre>
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ConfirmPopup from 'primevue/confirmpopup';
</code></pre>
@ -33,15 +30,13 @@ import ConfirmPopup from 'primevue/confirmpopup';
<h5>Getting Started</h5>
<p>ConfirmPopup is displayed by calling the <i>require</i> method of the <i>$confirm</i> instance by passing the options to customize the Popup.
<i>target</i> attribute is mandatory to align the popup to its caller.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;ConfirmPopup&gt;&lt;/ConfirmPopup&gt;
&lt;Button @click="delete($event)" icon="pi pi-check" label="Confirm"&gt;&lt;/Button&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
delete(event) {
@ -64,8 +59,7 @@ export default {
<h5>Composition API</h5>
<p>The service can be injected with the <i>useConfirm</i> function.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import { defineComponent } from "vue";
import { useConfirm } from "primevue/useconfirm";
@ -94,8 +88,7 @@ export default defineComponent({
<h5>Close Confirmation</h5>
<p>The popup can also be hidden programmatically using the <i>close</i> method.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
discard() {
@ -264,8 +257,7 @@ export default {
</a>
<LiveEditor name="ConfirmPopupDemo" :sources="sources" :confirmationService="true" :toastService="true" :components="['Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;ConfirmPopup&gt;&lt;/ConfirmPopup&gt;
&lt;div class="card"&gt;
@ -275,8 +267,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
confirm1(event) {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ContextMenu from 'primevue/contextmenu';
</code></pre>
@ -15,8 +14,7 @@ import ContextMenu from 'primevue/contextmenu';
<h5>Getting Started</h5>
<p>ContextMenu requires a collection of menuitems as its model.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -159,8 +157,7 @@ export default {
<h5>Document Menu</h5>
<p>Setting global property attaches the context menu to the document.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;ContextMenu :global="true" :model="items" /&gt;
</code></pre>
@ -168,15 +165,13 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;img alt="logo" src="demo/images/nature/nature3.jpg" @contextmenu="onImageRightClick"&gt;
&lt;ContextMenu ref="menu" :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -319,15 +314,13 @@ export default {
</a>
<LiveEditor name="ContextMenuDemo" :sources="sources" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;img alt="logo" src="demo/images/nature/nature3.jpg" @contextmenu="onImageRightClick" aria-haspopup="true"&gt;
&lt;ContextMenu ref="menu" :model="items" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -24,8 +24,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products"&gt;
&lt;Column field="code" header="Code"&gt;&lt;/Column&gt;
&lt;Column field="name" header="Name"&gt;&lt;/Column&gt;
@ -35,8 +34,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -64,8 +64,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :components="['ColumnGroup', 'Row', 'Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="sales"&gt;
&lt;ColumnGroup type="header"&gt;
&lt;Row&gt;
@ -115,8 +114,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -36,8 +36,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Fit Mode&lt;/h3&gt;
&lt;DataTable :value="products" :resizableColumns="true" columnResizeMode="fit" class="p-datatable-gridlines"&gt;
&lt;Column field="code" header="Code"&gt;&lt;/Column&gt;
@ -56,8 +55,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -28,8 +28,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column', 'MultiSelect']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products"&gt;
&lt;template #header&gt;
&lt;div style="text-align:left"&gt;
@ -43,8 +42,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -30,8 +30,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="ProductService" data="products-small" :components="['Column', 'ContextMenu']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" contextMenu v-model:contextMenuSelection="selectedProduct" @row-contextmenu="onRowContextMenu"&gt;
&lt;Column field="code" header="Code"&gt;&lt;/Column&gt;
&lt;Column field="name" header="Name"&gt;&lt;/Column&gt;
@ -47,8 +46,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -164,8 +164,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="ProductService" data="products" :components="['Column', 'Toolbar', 'Button', 'FileUpload', 'InputText', 'Rating', 'Dialog', 'RadioButton', 'Textarea', 'InputNumber', 'Dropdown']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;Toolbar class="p-mb-4"&gt;
&lt;template #left&gt;
@ -314,8 +313,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import ColumnGroup from 'primevue/columngroup'; //optional for column grouping
@ -15,8 +14,7 @@ import ColumnGroup from 'primevue/columngroup'; //optional for column groupi
<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>
<pre v-code.script>
<code>
<pre v-code.script><code>
import axios from 'axios'
export default class CarService {
@ -37,8 +35,7 @@ export default class CarService {
</code></pre>
<p>Example response;</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
{
"data": [
{"brand": "Volkswagen", "year": 2012, "color": "Orange", "vin": "dsad231ff"},
@ -57,8 +54,7 @@ export default class CarService {
</code></pre>
<p>Following sample datatable has 4 columns and retrieves the data from a service on mount.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -68,8 +64,7 @@ export default class CarService {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -91,16 +86,14 @@ export default {
<h5>Dynamic Columns</h5>
<p>Column components can be dynamically generated using a v-for as well.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars"&gt;
&lt;Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"&gt;&lt;/Column&gt;
&lt;/DataTable&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -321,8 +314,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars"&gt;
&lt;template #header&gt;
&lt;div&gt;
@ -358,8 +350,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" class="p-datatable-sm"&gt;
&lt;template #header&gt;
Small Table
@ -394,8 +385,7 @@ export default {
<h5>Column Grouping</h5>
<p>Columns can be grouped at header and footer sections by defining a ColumnGroup with nested rows and columns.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="sales"&gt;
&lt;ColumnGroup type="header"&gt;
&lt;Row&gt;
@ -434,8 +424,7 @@ export default {
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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :paginator="true" :rows="10"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -446,8 +435,7 @@ export default {
</code></pre>
<p>paginatorLeft and paginatorLeft templates are available to specify custom content at the left and right side.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :paginator="true" :rows="10"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -466,8 +454,7 @@ export default {
<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 v-model in case you'd like your binding to be updated whenever the user changes the page.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :paginator="true" :rows="10" :first="firstRecordIndex"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -481,8 +468,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars"&gt;
&lt;Column field="vin" header="Vin" :sortable="true"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" :sortable="true"&gt;&lt;/Column&gt;
@ -493,8 +479,7 @@ export default {
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" sortMode="multiple"&gt;
&lt;Column field="vin" header="Vin" :sortable="true"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" :sortable="true"&gt;&lt;/Column&gt;
@ -506,8 +491,7 @@ export default {
<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 v-model directive to get updated when the user applies sort a column.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" sortField="year" :sortOrder="1"&gt;
&lt;Column field="vin" header="Vin" :sortable="true"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" :sortable="true"&gt;&lt;/Column&gt;
@ -525,8 +509,7 @@ export default {
</code></pre>
<p>In multiple mode, use the <i>multiSortMeta</i> property and bind an array of SortMeta objects instead.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" sortMode="multiple" :multiSortMeta="multiSortMeta"&gt;
&lt;Column field="vin" header="Vin" :sortable="true"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" :sortable="true"&gt;&lt;/Column&gt;
@ -536,8 +519,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
multiSortMeta: [
@ -555,8 +537,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :filters="filters" :paginator="true" :rows="10"&gt;
&lt;template #header&gt;
&lt;div style="text-align: right"&gt;
@ -596,8 +577,7 @@ data() {
</code></pre>
<p>Custom filtering is implemented by setting the filterMatchMode to "custom" and defining a filter function.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Column field="vin" header="Vin" filterMatchMode="myOwnEquals"&gt;
&lt;template #filter&gt;
&lt;InputText type="text" v-model="filters['vin']" class="p-column-filter" /&gt;
@ -606,8 +586,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
methods: {
myOwnEquals(value, filter) {
if (filter === undefined || filter === null || (typeof filter === 'string' &amp;&amp; filter.trim() === '')) {
@ -633,8 +612,7 @@ methods: {
<p>In single mode, selection binding is an object reference.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" v-model:selection="selectedCar" selectionMode="single" dataKey="vin"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -645,8 +623,7 @@ methods: {
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" v-model:selection="selectedCars" selectionMode="multiple" dataKey="vin"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -657,8 +634,7 @@ methods: {
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" v-model:selection="selectedCars" selectionMode="multiple" dataKey="vin"&gt;
&lt;Column selectionMode="multiple"&gt;&lt;/Column&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -671,8 +647,7 @@ methods: {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="200px"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -684,8 +659,7 @@ methods: {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Button label="Show" icon="pi pi-external-link" @click="openDialog" /&gt;
&lt;Dialog header="Flex Scroll" v-model:visible="dialogVisible" :style="{width: '50vw'}" :maximizable="true" :modal="true" :contentStyle="{height: '300px'}"&gt;
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="flex"&gt;
@ -704,8 +678,7 @@ methods: {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div style="height: calc(100vh - 143px)"&gt;
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="flex"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -719,8 +692,7 @@ methods: {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="200px" style="width: 600px"&gt;
&lt;Column field="vin" header="Vin" headerStyle="width: 250px" columnKey="vin_1"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" headerStyle="width: 250px" columnKey="year_1"&gt;&lt;/Column&gt;
@ -736,8 +708,7 @@ methods: {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="200px" frozenWidth="300px" :loading="loading"&gt;
&lt;Column field="vin" header="Vin" headerStyle="width: 300px" columnKey="vin_1" :frozen="true"&gt;
&lt;template #body="slotProps"&gt;
@ -758,8 +729,7 @@ methods: {
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :scrollable="true" scrollHeight="200px" frozenWidth="300px" :loading="loading"&gt;
&lt;Column field="vin" header="Vin" headerStyle="width: 300px" bodyStyle="height: 25px" columnKey="vin" :frozen="true"&gt;
&lt;template #body="slotProps"&gt;
@ -774,8 +744,7 @@ methods: {
</code></pre>
<p>One or more rows can be displayed as fixed using the <i>frozenValue</i> property.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :frozenValue="frozenCars" :scrollable="true" scrollHeight="200px" :loading="loading"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -792,8 +761,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="lazyCars" :scrollable="true" scrollHeight="200px" :lazy="true" :rows="20"
:virtualScroll="true" :virtualRowHeight="30" @virtual-scroll="onVirtualScroll" :totalRecords="lazyTotalRecords"&gt;
&lt;Column field="vin" header="Vin"&gt;
@ -820,8 +788,7 @@ methods: {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -863,8 +830,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :lazy="true" :paginator="true" :rows="10"
:totalRecords="totalRecords" :loading="loading" @page="onPage($event)"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -875,8 +841,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -922,8 +887,7 @@ export default {
<p>Rows can be expanded to display additional content using the <i>expandedRows</i> property with the v-model directive 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" v-model:expandedRows="expandedRows" dataKey="vin"
@row-expand="onRowExpand" @row-collapse="onRowCollapse"&gt;
&lt;template #header&gt;
@ -955,8 +919,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1001,8 +964,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Basic Cell Editing&lt;/h3&gt;
&lt;p&gt;Simple editors with v-model.&lt;/p&gt;
&lt;DataTable :value="cars1" editMode="cell"&gt;
@ -1047,8 +1009,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
import Vue from 'vue';
@ -1136,8 +1097,7 @@ export default {
<p>Row Editing is defined by setting <i>cellEdit</i> as "row", defining <i>editingRows</i> with the v-model directive 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Row Editing&lt;/h3&gt;
&lt;DataTable :value="cars" editMode="row" dataKey="vin" v-model:editingRows="editingRows"
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel"&gt;
@ -1162,8 +1122,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
import Vue from 'vue';
@ -1199,8 +1158,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :resizableColumns="true" columnResizeMode="fit | expand"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -1211,8 +1169,7 @@ export default {
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :resizableColumns="true" columnResizeMode="fit | expand"&gt;
&lt;Column field="vin" header="Vin" headerStyle="width: 20%"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" headerStyle="width: 40%"&gt;&lt;/Column&gt;
@ -1225,8 +1182,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :reorderableColumns="true"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -1238,8 +1194,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" @row-reorder="onRowReorder"&gt;
&lt;Column :rowReorder="true" headerStyle="width: 3em" /&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -1250,8 +1205,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1284,8 +1238,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Subheader Grouping&lt;/h3&gt;
&lt;DataTable :value="cars" rowGroupMode="subheader" groupRowsBy="brand"
sortMode="single" sortField="brand" :sortOrder="1"&gt;
@ -1339,8 +1292,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1384,8 +1336,7 @@ export default {
<h5>Data Export</h5>
<p>DataTable can export its data in CSV format using <i>exportCSV()</i> method.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" ref="dt"&gt;
&lt;template #header&gt;
&lt;div style="text-align: left"&gt;
@ -1400,8 +1351,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1431,8 +1381,7 @@ export default {
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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :paginator="true" :rows="10" v-model:filters="filters"
stateStorage="session" stateKey="dt-state-demo-session"
v-model:selection="selectedCar" selectionMode="single" dataKey="vin"&gt;
@ -1476,8 +1425,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1523,8 +1471,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" contextMenu v-model:contextMenuSelection="selectedCar" @row-contextmenu="onRowContextMenu"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year"&gt;&lt;/Column&gt;
@ -1536,8 +1483,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1577,8 +1523,7 @@ export default {
<h5>Empty Message</h5>
<p>When there is no data, you may use the <i>empty</i> template to display a message.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars"&gt;
&lt;template #empty&gt;
No records found
@ -1594,8 +1539,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :loading="loading"&gt;
&lt;template #loading&gt;
Loading records, please wait...
@ -1608,8 +1552,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1638,8 +1581,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" class="p-datatable-responsive-demo"&gt;
&lt;template #header&gt;
Responsive
@ -1672,8 +1614,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1693,8 +1634,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.p-datatable-responsive-demo .p-datatable-tbody > tr > td .p-column-title {
display: none;
}
@ -1732,8 +1672,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="cars" :rowClass="rowClass"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
&lt;Column field="year" header="Year" bodyStyle="padding: 0"&gt;
@ -1749,8 +1688,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -1776,8 +1714,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.year-cell {
padding: 0.429em 0.857rem;
@ -2485,8 +2422,7 @@ export default {
</a>
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" data="customers-large" :components="['Column', 'InputText', 'MultiSelect', 'Calendar', 'Dropdown', 'ProgressBar', 'Button']" />
</div>
<pre v-code.script>
<code>
<pre v-code.script><code>
&#123;
"data": [
&#123;
@ -2509,8 +2445,7 @@ export default {
</code></pre>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="customers" :paginator="true" class="p-datatable-customers" :rows="10"
dataKey="id" :rowHover="true" v-model:selection="selectedCustomers" :filters="filters" :loading="loading"
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" :rowsPerPageOptions="[10,25,50]"
@ -2607,8 +2542,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {
@ -2675,8 +2609,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
::v-deep(.p-paginator) {
.p-paginator-current {
margin-left: auto;

View File

@ -21,16 +21,14 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products"&gt;
&lt;Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"&gt;&lt;/Column&gt;
&lt;/DataTable&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -98,8 +98,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column', 'InputText', 'Dropdown']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic Cell Editing&lt;/h5&gt;
&lt;p&gt;Simple editors with v-model.&lt;/p&gt;
&lt;DataTable :value="products1" editMode="cell" class="editable-cells-table"&gt;
@ -181,8 +180,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -289,8 +287,7 @@ export default {
</div>
</template>
<pre v-code.css>
<code>
<pre v-code.css><code>
::v-deep(.editable-cells-table td.p-cell-editing) {
padding-top: 0;
padding-bottom: 0;

View File

@ -29,8 +29,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" ref="dt"&gt;
&lt;template #header&gt;
&lt;div style="text-align: left"&gt;
@ -45,8 +44,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -103,8 +103,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" data="customers-large" :components="['Column', 'InputText', 'MultiSelect', 'Calendar', 'Dropdown', 'ProgressBar', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="customers" :paginator="true" class="p-datatable-customers" :rows="10"
dataKey="id" :filters="filters" :loading="loading"&gt;
&lt;template #header&gt;
@ -193,8 +192,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {

View File

@ -30,8 +30,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" class="p-datatable-gridlines"&gt;
&lt;template #header&gt;
Header
@ -47,8 +46,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -44,8 +44,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" :components="['Column', 'InputText']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="customers" :lazy="true" :paginator="true" :rows="10" :filters="filters" ref="dt"
:totalRecords="totalRecords" :loading="loading" @page="onPage($event)" @sort="onSort($event)"&gt;
&lt;Column field="name" header="Name" filterMatchMode="startsWith" ref="name" :sortable="true"&gt;
@ -72,8 +71,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {

View File

@ -33,8 +33,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" data="customers-large" :components="['Column', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="customers" :paginator="true" :rows="10"
paginatorTemplate="CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
:rowsPerPageOptions="[10,20,50]"
@ -53,8 +52,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {

View File

@ -22,8 +22,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" :reorderableColumns="true" @column-reorder="onColReorder" @row-reorder="onRowReorder"&gt;
&lt;Column :rowReorder="true" headerStyle="width: 3rem" :reorderableColumn="false" /&gt;
&lt;Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field"&gt;&lt;/Column&gt;
@ -31,8 +30,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -47,8 +47,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" class="p-datatable-responsive-demo" :paginator="true" :rows="10"&gt;
&lt;template #header&gt;
Responsive
@ -81,8 +80,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -102,8 +100,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.p-datatable-responsive-demo .p-datatable-tbody > tr > td .p-column-title {
display: none;
}

View File

@ -75,8 +75,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="ProductService" data="products-orders-small" :components="['Column', 'Button', 'Rating']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" v-model:expandedRows="expandedRows" dataKey="id"
@row-expand="onRowExpand" @row-collapse="onRowCollapse"&gt;
&lt;template #header&gt;
@ -137,8 +136,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -111,8 +111,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="CustomerService" data="customers-medium" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Subheader Grouping&lt;/h5&gt;
&lt;p&gt;Group customers by their representative.&lt;/p&gt;
@ -211,8 +210,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {

View File

@ -114,8 +114,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" data="customers-large" :components="['Column', 'Dialog', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Vertical&lt;/h5&gt;
&lt;DataTable :value="customers" :scrollable="true" scrollHeight="200px" :loading="loading"&gt;
@ -217,8 +216,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
export default {

View File

@ -87,8 +87,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" :toastService="true" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Single&lt;/h5&gt;
&lt;p&gt;In single mode, a row is selected on click event of a row. If the row is already selected then the row gets unselected.&lt;/p&gt;
@ -163,8 +162,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -51,8 +51,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" class="p-datatable-sm"&gt;
&lt;template #header&gt;
Small Table
@ -85,8 +84,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -76,8 +76,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Single Column&lt;/h5&gt;
&lt;DataTable :value="products"&gt;
@ -141,8 +140,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -133,8 +133,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="CustomerService" data="customers-medium" :components="['Column', 'InputText', 'MultiSelect', 'Dropdown']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Session Storage&lt;/h5&gt;
&lt;DataTable :value="customers" :paginator="true" :rows="10" v-model:filters="filters1"
@ -255,8 +254,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CustomerService from '../../service/CustomerService';
import DataTableDoc from './DataTableDoc';

View File

@ -24,8 +24,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" class="p-datatable-striped"&gt;
&lt;Column field="code" header="Code"&gt;&lt;/Column&gt;
&lt;Column field="name" header="Name"&gt;&lt;/Column&gt;
@ -35,8 +34,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -30,8 +30,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products" :rowClass="rowClass"&gt;
&lt;Column field="code" header="Code"&gt;&lt;/Column&gt;
&lt;Column field="name" header="Name"&gt;&lt;/Column&gt;
@ -47,8 +46,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -82,8 +80,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.outofstock {
font-weight: 700;
color: #FF5252;

View File

@ -51,8 +51,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="DataTableDemo" :sources="sources" service="ProductService" data="products-small" :components="['Column', 'Rating', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataTable :value="products"&gt;
&lt;template #header&gt;
&lt;div class="table-header"&gt;
@ -89,8 +88,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -115,8 +113,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.table-header {
display: flex;
align-items: center;

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import DataView from 'primevue/dataview';
</code></pre>
@ -14,8 +13,7 @@ import DataView from 'primevue/dataview';
<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>
<pre v-code.script>
<code><template v-pre>
<pre v-code.script><code><template v-pre>
export default {
data() {
return {
@ -37,8 +35,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;template #list="slotProps"&gt;
&lt;div class="p-col-12"&gt;
&lt;div class="car-details"&gt;
@ -69,8 +66,7 @@ export default {
<h5>Sections</h5>
<p>Header and Footer are the two templates that are capable of displaying custom content.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;template #header&gt;Header Content&lt;/template&gt;
&lt;template #footer&gt;Footer Content&lt;/template&gt;
@ -78,8 +74,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;template #empty&gt;No records found.&lt;/template&gt;
</code></pre>
@ -90,8 +85,7 @@ export default {
you can create your own that updates the layout property of the DataView.
</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataView :value="cars" :layout="layout"&gt;
&lt;template #header&gt;
&lt;DataViewLayoutOptions v-model="layout"&gt;&lt;/DataViewLayoutOptions&gt;
@ -109,8 +103,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataView :value="cars" :layout="layout" paginatorPosition="both" :paginator="true" :rows="20"&gt;
&lt;template #paginatorLeft&gt;
&lt;Button type="button" icon="pi pi-refresh"/&gt;
@ -131,8 +124,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataView :value="cars" :layout="layout" :sortOrder="sortOrder" :sortField="sortField"&gt;
&lt;template #header&gt;
&lt;div class="p-grid p-nogutter"&gt;
@ -154,8 +146,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code><template v-pre>
<pre v-code.script><code><template v-pre>
export default {
data() {
return {
@ -203,8 +194,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataView :value="cars" :layout="layout" :paginator="true" :rows="20" :lazy="true" @page="onPage($event)"&gt;
&lt;template #list="slotProps" &gt;
&lt;div&gt;Vin: &lt;b&gt;{{slotProps.data.vin}}&lt;/b&gt;&lt;/div&gt;
@ -216,8 +206,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code><template v-pre>
<pre v-code.script><code><template v-pre>
export default {
data() {
return {
@ -423,8 +412,7 @@ export default {
<LiveEditor name="DataViewDemo" :sources="sources" service="ProductService" data="products" :components="['DataViewLayoutOptions', 'Button', 'Dropdown', 'Rating']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DataView :value="products" :layout="layout" :paginator="true" :rows="9" :sortOrder="sortOrder" :sortField="sortField"&gt;
&lt;template #header&gt;
&lt;div class="p-grid p-nogutter"&gt;
@ -483,8 +471,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import DeferredContent from 'primevue/deferredcontent';
</code></pre>
<h5>Getting Started</h5>
<p>DeferredContent is used as a wrapper element of its content..</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DeferredContent&gt;
&lt;DataTable :value="cars"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -26,8 +24,7 @@ import DeferredContent from 'primevue/deferredcontent';
<h5>Load Event</h5>
<p>onLoad callback is useful to initialize the content when it becomes visible on scroll such as loading data.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;DeferredContent @load="onDataLoad"&gt;
&lt;DataTable :value="cars"&gt;
&lt;Column field="vin" header="Vin"&gt;&lt;/Column&gt;
@ -76,8 +73,7 @@ import DeferredContent from 'primevue/deferredcontent';
</a>
<LiveEditor name="DeferredContentDemo" :sources="sources" service="ProductService" :toastService="true" data="products-small" :components="['DataTable', 'Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div style="height: 800px"&gt;
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.
&lt;/div&gt;
@ -100,8 +96,7 @@ import DeferredContent from 'primevue/deferredcontent';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -3,24 +3,21 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Dialog from 'primevue/dialog';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog header="Header" v-model:visible="display" &gt;
Content
&lt;/Dialog&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -33,16 +30,14 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog header="Header" footer="Footer" v-model:visible="display"&gt;
Content
&lt;/Dialog&gt;
</code></pre>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog v-model:visible="display"&gt;
&lt;template #header&gt;
&lt;h3&gt;Header&lt;/h3&gt;
@ -60,8 +55,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog position="top" v-model:visible="display"&gt;
Content
&lt;/Dialog&gt;
@ -70,8 +64,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog v-model:visible="display" :contentStyle="{overflow: 'visible'}"&gt;
Content
&lt;/Dialog&gt;
@ -80,8 +73,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dialog v-model:visible="display"&gt;
Content
&lt;template #footer&gt;
@ -273,8 +265,7 @@ export default {
</a>
<LiveEditor name="DialogDemo" :sources="sources" :components="['Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;Button label="Show" icon="pi pi-external-link" @click="openBasic" /&gt;
&lt;Dialog header="Header" v-model:visible="displayBasic" :style="{width: '50vw'}"&gt;
@ -377,8 +368,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -437,8 +427,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.p-button {
margin: 0 .5rem 0 0;
min-width: 10rem;

View File

@ -27,8 +27,7 @@
</ul>
<h5>Examples</h5>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-inline"&gt;Displayed as inline.&lt;/div&gt;
&lt;div class="p-d-flex"&gt;Displayed as a flexbox container.&lt;/div&gt;
&lt;div class="p-d-block p-d-lg-inline"&gt;Inline for larger screens and block for others.&lt;/div&gt;
@ -47,8 +46,7 @@
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Inline&lt;/h5&gt;
&lt;InputText class="p-mr-2 p-d-inline" /&gt;

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Divider from 'primevue/divider';
</code></pre>
<h5>Getting Started</h5>
<p>Divider has two orientations defined with the <i>layout</i> property, default is "horizontal" and the alternative is "vertical".</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div&gt;Content 1&lt;/div&gt;
&lt;Divider /&gt;
&lt;div&gt;Content 2&lt;/div&gt;
@ -21,8 +19,7 @@ import Divider from 'primevue/divider';
<h5>Border Style</h5>
<p>Style of the border is configured with the <i>type</i> property and supports 3 values; default is "solid" and other possibilities are "dashed" and "dotted".</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div&gt;Content 1&lt;/div&gt;
&lt;Divider type="dashed"/&gt;
&lt;div&gt;Content 2&lt;/div&gt;
@ -31,8 +28,7 @@ import Divider from 'primevue/divider';
<h5>Vertical Divider</h5>
<p>Vertical divider is enabled by setting the <i>layout</i> property as "vertical".</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;
&lt;div&gt;Content 1&lt;/div&gt;
&lt;Divider layout="vertical" /&gt;
@ -48,8 +44,7 @@ import Divider from 'primevue/divider';
of the content is configured with the <i>align</i> property. In horizontal layout, alignment options
are "left", "center" and "right" whereas vertical mode supports "top", "center" and "bottom".
</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div&gt;Content 1&lt;/div&gt;
&lt;Divider align="left"&gt;
@ -181,8 +176,7 @@ import Divider from 'primevue/divider';
</a>
<LiveEditor name="DividerDemo" :sources="sources" :components="['InputText', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;p&gt;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

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Dropdown from 'primevue/dropdown';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dropdown v-model="selectedCity" :options="cities" optionLabel="name" placeholder="Select a City" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
selectedCity: null,
@ -40,8 +37,7 @@ data() {
<h5>Filtering</h5>
<p>Options can be filtered using an input field in the overlay by enabling the <i>filter</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" placeholder="Select a Car" :filter="true" filterPlaceholder="Find Car"/&gt;
</code></pre>
@ -49,8 +45,7 @@ data() {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" :filter="true" placeholder="Select a Car" :showClear="true"&gt;
&lt;template #value="slotProps"&gt;
&lt;div class="p-dropdown-car-value" v-if="slotProps.value"&gt;
@ -345,8 +340,7 @@ data() {
</a>
<LiveEditor name="DropdownDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;Dropdown v-model="selectedCity1" :options="cities" optionLabel="name" placeholder="Select a City" /&gt;
@ -374,8 +368,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,24 +3,21 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Editor from 'primevue/editor';
</code></pre>
<h5>Getting Started</h5>
<p>A model can be bound using the standard v-model directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Editor v-model="value" editorStyle="height: 320px"/&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Editor v-model="value" editorStyle="height: 320px"&gt;
&lt;template #toolbar&gt;
&lt;span class="ql-formats"&gt;
@ -139,8 +136,7 @@ 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>
<pre v-code>
<code>
<pre v-code><code>
npm install quill --save
</code></pre>
@ -153,8 +149,7 @@ npm install quill --save
</a>
<LiveEditor name="EditorDemo" :sources="sources" :directives="['Tooltip']"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Default&lt;/h3&gt;
&lt;Editor v-model="value1" editorStyle="height: 320px"/&gt;
@ -171,8 +166,7 @@ npm install quill --save
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -4,16 +4,14 @@
<TabPanel header="Documentation">
<h5>Getting Started</h5>
<p>Elevation is added to an element using the <i>.p-shadow-{level}</i> class.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-shadow-1" /&gt;
</code></pre>
<h5>Levels</h5>
<p>There are 24 depths available varying from 1 to 24.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-shadow-1" /&gt;
&lt;div class="p-shadow-24" /&gt;
@ -24,8 +22,7 @@
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-grid"&gt;
&lt;div class="p-col" v-for="index in 24" :key="index"&gt;
&lt;div :class="['box', 'p-shadow-' + index]"&gt;

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Fieldset from 'primevue/fieldset';
</code></pre>
<h5>Getting Started</h5>
<p>Fieldset is a container component that accepts content as its children.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Fieldset legend="Godfather I"&gt;
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.
@ -24,8 +22,7 @@ import Fieldset from 'primevue/fieldset';
<h5>Custom Header</h5>
<p>Header of the panel is either defined with the <i>legend</i> property or the legend template.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Fieldset&gt;
&lt;template #legend&gt;
Header Content
@ -38,8 +35,7 @@ import Fieldset from 'primevue/fieldset';
<h5>Toggleable</h5>
<p>Content of the fieldset can be expanded and collapsed using <i>toggleable</i> option..</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Fieldset legend="Godfather I" :toggleable="true"&gt;
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.
@ -50,8 +46,7 @@ import Fieldset from 'primevue/fieldset';
</code></pre>
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Fieldset legend="Header Text" :toggleable="true" :collapsed="true"&gt;
Content
&lt;/Fieldset&gt;
@ -59,8 +54,7 @@ import Fieldset from 'primevue/fieldset';
</code></pre>
<p>Use the v-model directive to enable two-way binding.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically&lt;/button&gt;
&lt;Fieldset legend="Header Text" :toggleable="true" v-model:collapsed="isCollapsed"&gt;
Content
@ -167,8 +161,7 @@ import Fieldset from 'primevue/fieldset';
</a>
<LiveEditor name="FieldsetDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Regular&lt;/h5&gt;
&lt;Fieldset legend="Header"&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
@ -187,8 +180,7 @@ import Fieldset from 'primevue/fieldset';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,32 +3,28 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import FileUpload from 'primevue/fileupload';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload name="demo[]" url="./upload" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload name="demo[]" url="./upload" :multiple="true" /&gt;
</code></pre>
<h5>Basic UI</h5>
<p>FileUpload basic mode provides a simpler UI as an alternative to advanced mode.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload mode="basic" name="demo[]" url="./upload" /&gt;
</code></pre>
@ -38,24 +34,21 @@ import FileUpload from 'primevue/fileupload';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload mode="basic" name="demo[]" url="./upload" :auto="true" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload mode="basic" name="demo[]" url="./upload" accept="image/*" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload name="demo[]" url="./upload" :maxFileSize="1000000" :fileLimit="3" /&gt;
</code></pre>
@ -75,14 +68,12 @@ 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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload name="demo[]" :customUpload="true" @uploader="myUploader" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
myUploader(event) {
//event.files == files to upload
}
@ -91,8 +82,7 @@ myUploader(event) {
<h5>Empty Template</h5>
<p>When there is no file selected, you may use the empty slot to display content.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;FileUpload name="demo[]" url="./upload" /&gt;
&lt;template #empty&gt;
&lt;p&gt;Drag and drop files to here to upload.&lt;/p&gt;
@ -332,8 +322,7 @@ myUploader(event) {
</a>
<LiveEditor name="FileUploadDemo" :sources="sources" :toastService="true" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Advanced&lt;/h3&gt;
&lt;FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000"&gt;
&lt;template #empty&gt;
@ -349,8 +338,7 @@ myUploader(event) {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
onUpload() {

View File

@ -8,8 +8,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;Flex Container&lt;/div&gt;
&lt;div class="p-d-inline-flex"&gt;Inline Flex Container&lt;/div&gt;
@ -28,8 +27,7 @@
</ul>
<h6>Row</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;
&lt;div class="p-mr-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2"&gt;Item 2&lt;/div&gt;
@ -44,8 +42,7 @@
</div>
<h6>Column</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-flex-column"&gt;
&lt;div class="p-mb-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mb-2"&gt;Item 2&lt;/div&gt;
@ -62,8 +59,7 @@
<h6>Responsive</h6>
<p>Row direction for larger screens and column for smaller.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-flex-column p-flex-md-row"&gt;
&lt;div class="p-mb-2 p-mr-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mb-2 p-mr-2"&gt;Item 2&lt;/div&gt;
@ -106,8 +102,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;
&lt;div class="p-mr-2 p-order-3"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2 p-order-1"&gt;Item 2&lt;/div&gt;
@ -123,8 +118,7 @@
<h6>Responsive</h6>
<p>Orders change depending on the screen size.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;
&lt;div class="p-mr-2 p-order-3 p-order-md-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2 p-order-1 p-order-md-3"&gt;Item 2&lt;/div&gt;
@ -189,8 +183,7 @@
</ul>
<h6>No Wrap</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex"&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 2&lt;/div&gt;
@ -211,8 +204,7 @@
</div>
<h6>Wrap</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-flex-wrap"&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 2&lt;/div&gt;
@ -233,8 +225,7 @@
</div>
<h6>Wrap Reverse</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-flex-wrap-reverse"&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 1&lt;/div&gt;
&lt;div class="p-mr-2 p-mb-2"&gt;Item 2&lt;/div&gt;
@ -286,8 +277,7 @@
</ul>
<h6>Between</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-jc-between"&gt;
&lt;div&gt;Item 1&lt;/div&gt;
&lt;div&gt;Item 2&lt;/div&gt;
@ -300,8 +290,7 @@
</div>
<h6>Center</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-jc-center"&gt;
&lt;div class="p-mr-2"&gt;Item 1&lt;/div&gt;
&lt;div&gt;Item 2&lt;/div&gt;
@ -359,8 +348,7 @@
</ul>
<h6>Start</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-ai-start"&gt;
&lt;div class="p-mr-2" style="height:100px"&gt;Item 1&lt;/div&gt;
&lt;div style="height:50px"&gt;Item 2&lt;/div&gt;
@ -373,8 +361,7 @@
</div>
<h6>Center</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-ai-center"&gt;
&lt;div class="p-mr-2" style="height:100px"&gt;Item 1&lt;/div&gt;
&lt;div style="height:50px"&gt;Item 2&lt;/div&gt;
@ -426,8 +413,7 @@
<li>stretch (default)</li>
</ul>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex" style="height: 150px;"&gt;
&lt;div class="p-mr-2 p-as-start"&gt;Start&lt;/div&gt;
&lt;div class="p-mr-2 p-as-center"&gt;Center&lt;/div&gt;
@ -522,8 +508,7 @@
<p>When combined with <router-link to="/setup">spacing utilities</router-link>, flexbox offers endless possibilities.</p>
<h6>Horizontal Spacing</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-p-3 card"&gt;
&lt;Button type="Button" icon="pi pi-check" class="p-mr-2" /&gt;
&lt;Button type="Button" icon="pi pi-trash" class="p-button-danger"/&gt;
@ -538,8 +523,7 @@
</div>
<h6>Vertical Spacing</h6>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-d-flex p-flex-column" style="height:150px"&gt;
&lt;div&gt;Item 1&lt;/div&gt;
&lt;div class="p-mt-auto"&gt;Item 2&lt;/div&gt;

View File

@ -113,8 +113,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="FloatLabelDemo" :sources="sources" service="CountryService" data="countries" :components="['InputText', 'AutoComplete', 'Calendar', 'Chips', 'InputMask', 'InputNumber', 'CascadeSelect', 'Dropdown', 'MultiSelect', 'Textarea']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-fluid p-grid"&gt;
&lt;div class="p-field p-col-12 p-md-4"&gt;
&lt;span class="p-float-label"&gt;
@ -213,8 +212,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CountryService from '../../service/CountryService';
export default {

View File

@ -4,8 +4,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-field"&gt;
&lt;label for="fieldId"&gt;Label&lt;/label&gt;
&lt;InputText id="fieldId" type="text" /&gt;
@ -15,8 +14,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-fluid"&gt;
&lt;div class="p-field"&gt;
&lt;label for="firstname"&gt;Firstname&lt;/label&gt;
@ -33,8 +31,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-fluid p-formgrid p-grid"&gt;
&lt;div class="p-field p-col"&gt;
&lt;label for="firstname"&gt;Firstname&lt;/label&gt;
@ -52,8 +49,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-field p-grid"&gt;
&lt;label for="firstname" class="p-col-fixed" style="width:100px"&gt;Firstname&lt;/label&gt;
&lt;div class="p-col"&gt;
@ -71,8 +67,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-fluid"&gt;
&lt;div class="p-field p-grid"&gt;
&lt;label for="firstname" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0"&gt;Firstname&lt;/label&gt;
@ -93,8 +88,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-formgroup-inline"&gt;
&lt;div class="p-field"&gt;
&lt;label for="firstname" class="p-sr-only"&gt;Firstname&lt;/label&gt;
@ -112,8 +106,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;h3&gt;Vertical Checkbox&lt;/h3&gt;
&lt;div class="p-field-checkbox"&gt;
&lt;Checkbox id="city1" name="city1" value="Chicago" v-model="cities1" /&gt;
@ -138,8 +131,7 @@
</code></pre>
<pre v-code>
<code>
<pre v-code><code>
&lt;h3&gt;Vertical RadioButton&lt;/h3&gt;
&lt;div class="p-field-radiobutton"&gt;
&lt;RadioButton id="city5" name="city1" value="Chicago" v-model="city1" /&gt;
@ -166,8 +158,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-field p-fluid"&gt;
&lt;label for="username"&gt;Username&lt;/label&gt;
&lt;InputText id="username" type="username" aria-describedby="username-help" /&gt;
@ -178,8 +169,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-fluid p-formgrid p-grid"&gt;
&lt;div class="p-field p-col-12 p-md-6"&gt;
&lt;label for="firstname"&gt;Firstname&lt;/label&gt;
@ -242,8 +232,7 @@
</a>
<LiveEditor name="FormLayoutDemo" :sources="sources" :components="['InputText', 'Button', 'Checkbox', 'RadioButton', 'Textarea', 'Dropdown']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Vertical&lt;/h3&gt;
&lt;div class="p-fluid"&gt;
&lt;div class="p-field"&gt;
@ -392,8 +381,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import FullCalendar from 'primevue/fullcalendar';
</code></pre>
@ -12,15 +11,13 @@ import FullCalendar from 'primevue/fullcalendar';
<h5>Getting Started</h5>
<p>FullCalendar is a wrapper around on <a href="https://fullcalendar.io/docs/v4">FullCalendar 5.4.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>
<pre v-code>
<code>
<pre v-code><code>
npm install @fullcalendar/core --save
</code></pre>
<p>FullCalendar is plugin based so install the plugins you require and define them with the options property.</p>
<pre v-code>
<code>
<pre v-code><code>
npm install @fullcalendar/daygrid --save
npm install @fullcalendar/timegrid --save
npm install @fullcalendar/interaction --save
@ -28,14 +25,12 @@ npm install @fullcalendar/interaction --save
</code></pre>
<p>Events should be an array and defined using the events property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;FullCalendar :events="events" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -81,8 +76,7 @@ export default {
</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>
<pre v-code.script>
<code>
<pre v-code.script><code>
import axios from 'axios';
export default class EventService {
@ -95,8 +89,7 @@ export default class EventService {
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import EventService from '../../service/EventService';
export default {
@ -118,14 +111,12 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;FullCalendar :events="events" :options="options" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import EventService from '../../service/EventService';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
@ -160,8 +151,7 @@ export default {
<h5>Callbacks</h5>
<p>Callbacks of the FullCalendar such as dateClick are also defined with the options property.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -221,14 +211,12 @@ export default {
</a>
<LiveEditor name="FullCalendarDemo" :sources="sources" service="EventService" data="events"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;FullCalendar :events="events" :options="options" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import EventService from '../../service/EventService';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';

View File

@ -38,8 +38,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Galleria ref="galleria" :value="images" v-model:activeIndex="activeIndex" :numVisible="5" containerStyle="max-width: 640px" :containerClass="galleriaClass"
:showThumbnails="showThumbnails" :showItemNavigators="true" :showItemNavigatorsOnHover="true"
:circular="true" :autoPlay="true" :transitionInterval="3000"&gt;
@ -66,8 +65,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {
@ -101,8 +99,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
::v-deep(.custom-galleria) {
&.fullscreen {
display: flex;

View File

@ -24,8 +24,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"
:circular="true" :autoPlay="true" :transitionInterval="2000"&gt;
&lt;template #item="slotProps"&gt;
@ -38,8 +37,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -29,8 +29,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"&gt;
&lt;template #item="{item}"&gt;
&lt;img :src="item.itemImageSrc" :alt="item.alt" style="width: 100%; display: block;" /&gt;
@ -48,8 +47,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Galleria from 'primevue/galleria';
</code></pre>
<h5>Getting Started</h5>
<p>Galleria requires item template and a value as an array of objects.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Galleria :value="images"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" /&gt;
@ -23,8 +21,7 @@ import Galleria from 'primevue/galleria';
<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">
<pre v-code.script>
<code>
<pre v-code.script><code>
{
"data":[
{
@ -123,8 +120,7 @@ import Galleria from 'primevue/galleria';
</code></pre>
</div>
<pre v-code.script>
<code>
<pre v-code.script><code>
import axios from 'axios'
export default class PhotoService {
@ -136,8 +132,7 @@ export default class PhotoService {
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -158,8 +153,7 @@ export default {
<h5>Items per page</h5>
<p>Number of items per page is defined using the <i>numVisible</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Galleria :value="images" :numVisible="5"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" /&gt;
@ -175,8 +169,7 @@ export default {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" /&gt;
@ -188,8 +181,7 @@ export default {
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
responsiveOptions: [
{
breakpoint: '1024px',
@ -209,8 +201,7 @@ responsiveOptions: [
<h5>Header and Footer</h5>
<p>Custom content projection is available using the <i>header</i> and <i>footer</i> properties.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"&gt;
&lt;template #header&gt;
&lt;h1&gt;Header&lt;/h1&gt;
@ -228,8 +219,7 @@ responsiveOptions: [
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Galleria :value="images" :showIndicators="true"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" /&gt;
@ -458,8 +448,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" /&gt;
@ -471,8 +460,7 @@ responsiveOptions: [
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -61,8 +61,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;With Thumbnails&lt;/h3&gt;
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions2" :numVisible="9" containerStyle="max-width: 50%"
:circular="true" :fullScreen="true" :showItemNavigators="true" v-model:visible="displayBasic"&gt;
@ -108,8 +107,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -87,8 +87,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Indicators with Click Event&lt;/h3&gt;
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"
:showThumbnails="false" :showIndicators="true"&gt;
@ -152,8 +151,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {
@ -191,8 +189,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
::v-deep(.custom-indicator-galleria) {
.indicator-text {
color: #e9ecef;

View File

@ -64,8 +64,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Item Navigators and Thumbnails&lt;/h3&gt;
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" containerStyle="max-width: 640px"
:showItemNavigators="true"&gt;
@ -112,8 +111,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -28,8 +28,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div style="padding: .5rem 0"&gt;
&lt;Button icon="pi pi-minus" @click="prev" class="p-button-secondary" /&gt;
&lt;Button icon="pi pi-plus" @click="next" class="p-button-secondary" style="margin-left: .5rem" /&gt;
@ -46,8 +45,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -23,8 +23,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="7" :circular="true" style="max-width: 800px"&gt;
&lt;template #item="slotProps"&gt;
&lt;img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" /&gt;
@ -36,8 +35,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -64,8 +64,7 @@
<div class="content-section documentation">
<TabView>
<TabPanel header="Source">
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Positioned at Bottom&lt;/h3&gt;
&lt;Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"&gt;
&lt;template #item="slotProps"&gt;
@ -112,8 +111,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PhotoService from '../../service/PhotoService';
export default {

View File

@ -5,8 +5,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col"&gt;1&lt;/div&gt;
&lt;div class="p-col"&gt;2&lt;/div&gt;
@ -31,8 +30,7 @@
<p>FlexGrid includes a 12 column based layout utility where width of a column is defined with the <i>p-col-&#123;number&#125;</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-4"&gt;4&lt;/div&gt;
&lt;div class="p-col"&gt;1&lt;/div&gt;
@ -97,8 +95,7 @@
<h5>MultiLine</h5>
<p>When the number of columns exceed 12, columns wrap to a new line.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-6"&gt;6&lt;/div&gt;
&lt;div class="p-col-6"&gt;6&lt;/div&gt;
@ -125,8 +122,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-fixed" style="width:100px"&gt;Fixed&lt;/div&gt;
&lt;div class="p-col"&gt;Auto&lt;/div&gt;
@ -184,8 +180,7 @@
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-12 p-md-6 p-lg-3"&gt;A&lt;/div&gt;
&lt;div class="p-col-12 p-md-6 p-lg-3"&gt;B&lt;/div&gt;
@ -211,8 +206,7 @@
</div>
<h5>Offset</h5>
<p>Offset classes allow defining a left margin on a column to avoid adding empty columns for spacing.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid"&gt;
&lt;div class="p-col-6 p-offset-3"&gt;6&lt;/div&gt;
&lt;/div&gt;
@ -286,8 +280,7 @@
<h5>Nested</h5>
<p>Columns can be nested to create more complex layouts.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid nested-grid"&gt;
&lt;div class="p-col-8"&gt;
&lt;div class="p-grid"&gt;
@ -332,8 +325,7 @@
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-grid p-nogutter"&gt;
&lt;div class="p-col"&gt;1&lt;/div&gt;
&lt;div class="p-col p-nogutter"&gt;2&lt;/div&gt;
@ -347,8 +339,7 @@
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
<h5>Basic</h5>
&lt;div class="p-grid"&gt;
&lt;div class="p-col"&gt;
@ -719,8 +710,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -739,8 +729,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.flexgrid-demo {
.box {
background-color: var(--surface-e);

View File

@ -7,8 +7,7 @@
<h5>Download</h5>
<p>PrimeIcons is available at npm, run the following command to download it to your project.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
npm install primeicons --save
</code></pre>
@ -17,8 +16,7 @@ npm install primeicons --save
<p>PrimeIcons use the <strong>pi pi-&#123;icon&#125;</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;i class="pi pi-check"&gt;&lt;/i&gt;
&lt;i class="pi pi-times"&gt;&lt;/i&gt;
@ -30,16 +28,14 @@ npm install primeicons --save
<h5>Size</h5>
<p>Size of the icons can easily be changed using font-size property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;i class="pi pi-check"&gt;&lt;/i&gt;
</code></pre>
<i class="pi pi-check"></i>
<pre v-code>
<code>
<pre v-code><code>
&lt;i class="pi pi-check" style="fontSize: 2rem"&gt;&lt;/i&gt;
</code></pre>
@ -48,8 +44,7 @@ npm install primeicons --save
<h5>Spinning Animation</h5>
<p>Special pi-spin class applies continuous rotation to an icon.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;i class="pi pi-spin pi-spinner" style="fontSize: 2rem"&gt;&lt;/i&gt;
</code></pre>

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Inplace from 'primevue/inplace';
</code></pre>
@ -12,8 +11,7 @@ import Inplace from 'primevue/inplace';
<h5>Getting Started</h5>
<p>Inplace requires <i>display</i> and <i>content</i> templates to define the content of each state.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Inplace&gt;
&lt;template #display&gt;
&lt;span class="pi pi-search" style="vertical-align: middle"&gt;&lt;/span&gt;
@ -28,8 +26,7 @@ import Inplace from 'primevue/inplace';
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Inplace :closable="true"&gt;
&lt;template #display&gt;
&#123;&#123;text || 'Click to Edit'&#125;&#125;
@ -43,8 +40,7 @@ import Inplace from 'primevue/inplace';
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Inplace @open="loadData"&gt;
&lt;template #display&gt;
View Data
@ -61,8 +57,7 @@ import Inplace from 'primevue/inplace';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CarService from '../../service/CarService';
export default {
@ -176,8 +171,7 @@ export default {
</a>
<LiveEditor name="InplaceDemo" :sources="sources" service="ProductService" data="products-small" :components="['InputText', 'DataTable', 'Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Input&lt;/h3&gt;
&lt;Inplace :closable="true"&gt;
&lt;template #display&gt;
@ -216,8 +210,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -8,8 +8,7 @@
</a>
<LiveEditor name="InputGroupDemo" :sources="sources" :components="['InputText', 'Button', 'RadioButton', 'Checkbox']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Addons&lt;/h3&gt;
&lt;div class="p-grid p-fluid"&gt;
&lt;div class="p-col-12 p-md-4"&gt;
@ -114,8 +113,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import InputMask from 'primevue/inputmask';
</code></pre>
<h5>Getting Started</h5>
<p>A model can be bound using the standard v-model directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputMask v-model="value" mask="99-999999" /&gt;
</code></pre>
@ -31,16 +29,14 @@ import InputMask from 'primevue/inputmask';
* - Alpha numberic character (A-Z,a-z,0-9)
</li>
</ul>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputMask v-model="value" mask="a*-999-a999" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputMask v-model="value" mask="99/99/9999" slotChar="mm/dd/yyyy" /&gt;
</code></pre>
@ -49,8 +45,7 @@ import InputMask from 'primevue/inputmask';
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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputMask v-model="value" mask="(999) 999-9999? x99999" /&gt;
</code></pre>
@ -135,8 +130,7 @@ import InputMask from 'primevue/inputmask';
</a>
<LiveEditor name="InputMaskDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-fluid p-formgrid p-grid"&gt;
&lt;div class="p-field p-col-12 p-md-4"&gt;
&lt;label for="basic"&gt;Basic&lt;/label&gt;
@ -171,8 +165,7 @@ import InputMask from 'primevue/inputmask';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import InputNumber from 'primevue/inputnumber';
</code></pre>
@ -12,31 +11,27 @@ import InputNumber from 'primevue/inputnumber';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputNumber v-model="value" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputNumber v-model="value" mode="decimal" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputNumber v-model="value1" mode="decimal" :minFractionDigits="2" /&gt;
&lt;InputNumber v-model="value2" mode="decimal" :minFractionDigits="2" :maxFractionDigits="2" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
User Locale
&lt;InputNumber v-model="value1" mode="decimal" :minFractionDigits="2" /&gt;
@ -54,8 +49,7 @@ Indian Locale
<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>
<pre v-code>
<code>
<pre v-code><code>
United States
&lt;InputNumber v-model="value1" mode="currency" currency="USD" locale="en-US" /&gt;
@ -72,8 +66,7 @@ Japan
<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>
<pre v-code>
<code>
<pre v-code><code>
Mile
&lt;InputNumber v-model="value1" suffix=" mi" /&gt;
@ -91,8 +84,7 @@ Temperature
<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>
<pre v-code>
<code>
<pre v-code><code>
Stacked
&lt;InputNumber v-model="value1" showButtons mode="currency" currency="USD" /&gt;
@ -108,8 +100,7 @@ Vertical
<h5>Step</h5>
<p>Step factor is 1 by default and can be customized with <i>step</i> option.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputNumber v-model="value" :step="0.25" /&gt;
</code></pre>
@ -117,8 +108,7 @@ Vertical
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputNumber v-model="value" :min="0" :max="100" /&gt;
</code></pre>
@ -372,8 +362,7 @@ Vertical
</a>
<LiveEditor name="InputNumberDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Numerals&lt;/h3&gt;
&lt;div class="p-fluid p-grid p-formgrid"&gt;
&lt;div class="p-field p-col-12 p-md-3"&gt;
@ -476,8 +465,7 @@ Vertical
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import InputSwitch from 'primevue/inputswitch';
</code></pre>
<h5>Getting Started</h5>
<p>Two-way binding to a boolean property is defined using the standard v-model directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputSwitch v-model="checked" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -31,8 +28,7 @@ export default {
<p>As model is two-way binding enabled, setting the bound value as true displays the state as checked by default.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -107,8 +103,7 @@ export default {
</a>
<LiveEditor name="InputSwitchDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Basic&lt;/h3&gt;
&lt;InputSwitch v-model="checked1" /&gt;
@ -117,8 +112,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,24 +3,21 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import InputText from 'primevue/inputtext';
</code></pre>
<h5>Getting Started</h5>
<p>A model can be bound using the standard v-model directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputText type="text" v-model="value" /&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;span class="p-float-label"&gt;
&lt;InputText id="username" type="text" v-model="value" /&gt;
&lt;label for="username"&gt;Username&lt;/label&gt;
@ -31,8 +28,7 @@ import InputText from 'primevue/inputtext';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;span class="p-input-icon-left"&gt;
&lt;i class="pi pi-search" /&gt;
&lt;InputText type="text" v-model="value1" placeholder="Search" /&gt;
@ -54,8 +50,7 @@ import InputText from 'primevue/inputtext';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputText type="text" class="p-inputtext-sm" placeholder="Small" /&gt;
&lt;InputText type="text" placeholder="Normal" /&gt;
&lt;InputText type="text" class="p-inputtext-lg" placeholder="Large" /&gt;
@ -64,8 +59,7 @@ import InputText from 'primevue/inputtext';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-inputtext-sm"&gt;
&lt;InputText /&gt;
&lt;InputNumber /&gt;
@ -79,8 +73,7 @@ import InputText from 'primevue/inputtext';
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>
<pre v-code>
<code>
<pre v-code><code>
&lt;div class="p-input-filled"&gt;
&lt;InputText type="text" /&gt;
&lt;InputText type="text" /&gt;
@ -157,8 +150,7 @@ import InputText from 'primevue/inputtext';
</a>
<LiveEditor name="InputTextDemo" :sources="sources" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="card"&gt;
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;InputText type="text" v-model="value1" /&gt;
@ -209,8 +201,7 @@ import InputText from 'primevue/inputtext';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -55,8 +55,7 @@
<div class="p-d-flex p-jc-end">
<LiveEditor name="InvalidDemo" :sources="sources" service="CountryService" data="countries" :components="['InputText', 'AutoComplete', 'Calendar', 'Chips', 'InputMask', 'InputNumber', 'CascadeSelect', 'Dropdown', 'MultiSelect', 'Textarea']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-fluid p-grid"&gt;
&lt;div class="p-field p-col-12 p-md-4"&gt;
&lt;InputText id="inputtext" type="text" v-model="value1" placeholder="InputText" class="p-invalid" /&gt;
@ -96,8 +95,7 @@
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import CountryService from '../../service/CountryService';
export default {

View File

@ -3,21 +3,18 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Knob from 'primevue/knob';
</code></pre>
<h5>Getting Started</h5>
<p>Knob is an input component and used with the standard <i>v-model</i> directive.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Knob v-model="value" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
value: 0
@ -28,16 +25,14 @@ data() {
<h5>Minimum and Maximum</h5>
<p>Boundaries are configured with the <i>min</i> and <i>max</i> values whose defaults are 0 and 100 respectively.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Knob v-model="value" :min="-50" :max="10" /&gt;
</code></pre>
<h5>Step</h5>
<p>Step factor is 1 by default and can be customized with <i>step</i> option.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Knob v-model="value" :step="10" /&gt;
</code></pre>
@ -45,16 +40,14 @@ data() {
<h5>Styling</h5>
<p><i>valueColor</i> defines the value color, <i>rangeColor</i> defines the range background and similarly <i>textColor</i> configures the color of the value text.
In addition, <i>strokeWidth</i> is used to determine the width of the stroke of range and value sections.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Knob v-model="value" valueColor="SlateGray" rangeColor="MediumTurquoise" /&gt;
</code></pre>
<h5>Size</h5>
<p>Default size of the Knob is 100 pixels for width and height, use the <i>size</i> property to customize it per your requirements.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Knob v-model="value" :size="200" /&gt;
</code></pre>
@ -216,8 +209,7 @@ data() {
</a>
<LiveEditor name="KnobDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;div class="p-grid p-formgrid p-text-center"&gt;
&lt;div class="p-field p-col-12 p-md-4"&gt;
&lt;h5&gt;Basic&lt;/h5&gt;
@ -259,8 +251,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Listbox from 'primevue/listbox';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Listbox v-model="selectedCity" :options="cities" optionLabel="name" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
selectedCity: null,
@ -38,16 +35,14 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Listbox v-model="selectedCity" :options="cities" optionLabel="name" :multiple="true"/&gt;
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Listbox v-model="selectedCars" :options="cars" :multiple="true" :filter="true" optionLabel="brand" listStyle="max-height:250px" style="width:15em"&gt;
&lt;template #option="slotProps"&gt;
&lt;div&gt;
@ -61,8 +56,7 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Listbox v-model="selectedCity" :options="cities" optionLabel="name" :filter="true"/&gt;
</code></pre>
@ -242,8 +236,7 @@ data() {
</a>
<LiveEditor name="ListboxDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Single&lt;/h5&gt;
&lt;Listbox v-model="selectedCity" :options="cities" optionLabel="name" style="width:15rem" /&gt;
@ -259,8 +252,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -6,8 +6,7 @@
<h5>Getting Started</h5>
<p>Locale values are stored in the global configuration that becomes accessible after installing the PrimeVue.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
import {createApp} from 'vue';
import PrimeVue from 'primevue/config';
const app = createApp(App);
@ -17,8 +16,7 @@ app.use(PrimeVue);
</code></pre>
<p>Second parameter of the <i>use</i> function can be used to initiate the locale during PrimeVue installation.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
app.use(PrimeVue, {
locale: {
accept: 'Aceptar',
@ -33,8 +31,7 @@ app.use(PrimeVue, {
application and need to change the language dynamically.</p>
<h6>Options API</h6>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
methods: {
changeToSpanish() {
@ -47,8 +44,7 @@ export default {
</code></pre>
<h6>Composition API</h6>
<pre v-code.script>
<code>
<pre v-code.script><code>
import { defineComponent, reactive } from "vue";
import { usePrimeVue } from "primevue/config";

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import MegaMenu from 'primevue/megamenu';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;MegaMenu :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -142,16 +139,14 @@ export default {
<h5>Orientation</h5>
<p>Default orientation is "horizontal" with "vertical" as the alternative.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;MegaMenu :model="items" orientation="vertical" /&gt;
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;MegaMenu :model="items"&gt;
&lt;InputText placeholder="Search" type="text" /&gt;
&lt;Button label="Logout" icon="pi pi-power-off" /&gt;
@ -259,8 +254,7 @@ export default {
<LiveEditor name="MegaMenuDemo" :sources="sources" :router="true" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Horizontal&lt;/h3&gt;
&lt;MegaMenu :model="items" /&gt;
@ -269,8 +263,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Menu from 'primevue/menu';
</code></pre>
@ -14,14 +13,12 @@ import Menu from 'primevue/menu';
<h5>Getting Started</h5>
<p>Menu requires a collection of menuitems as its model.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Menu :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -59,8 +56,7 @@ export default {
<h5>SubMenus</h5>
<p>Menu supports one level of nesting via subitems of an item.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
const items: [
{
label: 'Options',
@ -79,15 +75,13 @@ const items: [
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button type="button" label="Toggle" @click="toggle" /&gt;
&lt;Menu ref="menu" :model="items" :popup="true" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
toggle(event) {
this.$refs.menu.toggle(event);
}
@ -218,8 +212,7 @@ toggle(event) {
</a>
<LiveEditor name="MenuDemo" :sources="sources" :toastService="true" :router="true" :components="['Button']"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Inline&lt;/h3&gt;
&lt;Menu :model="items" /&gt;
@ -229,8 +222,7 @@ toggle(event) {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Menubar from 'primevue/menubar';
</code></pre>
@ -14,14 +13,12 @@ import Menubar from 'primevue/menubar';
<h5>Getting Started</h5>
<p>Menubar requires a collection of menuitems as its model.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Menubar :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -161,8 +158,7 @@ export default {
<h5>Custom Content</h5>
<p>Two slots named "start" and "end" are provided to embed content before or after the menubar.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Menubar :model="items"&gt;
&lt;template #start&gt;
Before
@ -251,8 +247,7 @@ export default {
</a>
<LiveEditor name="MenubarDemo" :sources="sources" :router="true" :components="['InputText']"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Menubar :model="items"&gt;
&lt;template #start&gt;
&lt;img alt="logo" src="../../assets/images/logo.svg" height="40" class="p-mr-2"&gt;
@ -265,8 +260,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -9,8 +9,7 @@
<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>
<pre v-code.script>
<code>
<pre v-code.script><code>
const items: [
{
label: 'Options',
@ -117,8 +116,7 @@ const items: [
<h5>Command</h5>
<p>The function to invoke when an item is clicked is defined using the command property.</p>
<pre v-code.script>
<code>
<pre v-code.script><code>
const items = [
{
label: 'New',
@ -134,8 +132,7 @@ const items = [
<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>
<pre v-code.script>
<code>
<pre v-code.script><code>
const items = [
{
label: 'Internal',
@ -154,8 +151,7 @@ const items = [
<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>
<pre v-code.script>
<code>
<pre v-code.script><code>
const items = [
{
label: 'Remove',

View File

@ -3,30 +3,26 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Message from 'primevue/message';
</code></pre>
<h5>Getting Started</h5>
<p>Message component requires a content to display.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Message&gt;Welcome to PrimeVue&lt;/Message&gt;
</code></pre>
<p>Multiple messages can be displayed using the standard v-for directive.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Message v-for="msg of messages" :severity="msg.severity" :key="msg.content"&gt;{{msg.content}}&lt;/Message&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
messages: [
@ -51,8 +47,7 @@ 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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Message severity="success" :closable="false"&gt;Order Submitted&lt;/Message&gt;
</code></pre>
@ -60,22 +55,19 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Message severity="warn" :life="5000" :sticky="false"&gt;This message will hide in 5 seconds.&lt;/Message&gt;
</code></pre>
<h5>Inline Message Component</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import InlineMessage from 'primevue/inlinemessage';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;InputText placeholder="Username" class="p-invalid" /&gt;
&lt;InlineMessage&gt;Field is required&lt;/InlineMessage&gt;
@ -266,8 +258,7 @@ import InlineMessage from 'primevue/inlinemessage';
</a>
<LiveEditor name="MessageDemo" :sources="sources" :components="['InlineMessage', 'Button']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Severities&lt;/h5&gt;
&lt;Message severity="success"&gt;Success Message Content&lt;/Message&gt;
&lt;Message severity="info"&gt;Info Message Content&lt;/Message&gt;
@ -314,8 +305,7 @@ import InlineMessage from 'primevue/inlinemessage';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -336,8 +326,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
button.p-button {
margin-right: .5rem;
}

View File

@ -3,22 +3,19 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import MultiSelect from 'primevue/multiselect';
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;MultiSelect v-model="selectedCars" :options="cars" optionLabel="brand" placeholder="Select Brands" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
data() {
return {
selectedCars: null,
@ -40,8 +37,7 @@ data() {
<h5>Chips Display</h5>
<p>A comma separated list is used by default to display selected items whereas alternative chip mode is provided using the <i>display</i> property to visualize the items as tokens.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;MultiSelect v-model="selectedCars" :options="cars" optionLabel="brand" placeholder="Select Brands" display="chip"/&gt;
</code></pre>
@ -49,8 +45,7 @@ data() {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;MultiSelect v-model="selectedCars2" :options="cars" optionLabel="brand" placeholder="Select a Car"&gt;
&lt;template #value="slotProps"&gt;
&lt;div class="p-multiselect-car-token" v-for="option of slotProps.value" :key="option.brand"&gt;
@ -73,8 +68,7 @@ data() {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;MultiSelect v-model="selectedCars" :options="cars" :filter="true" optionLabel="brand" placeholder="Select Brands"/&gt;
</code></pre>
@ -335,8 +329,7 @@ data() {
<LiveEditor name="MultiSelectDemo" :sources="sources"/>
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;MultiSelect v-model="selectedCities1" :options="cities" optionLabel="name" placeholder="Select a City" /&gt;
@ -364,8 +357,7 @@ data() {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -397,8 +389,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.p-multiselect {
min-width: 15rem;
}

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import OrderList from 'primevue/orderlist';
</code></pre>
@ -14,8 +13,7 @@ import OrderList from 'primevue/orderlist';
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrderList v-model="cars" listStyle="height:auto" dataKey="vin"&gt;
&lt;template #header&gt;
List of Cars
@ -40,8 +38,7 @@ import OrderList from 'primevue/orderlist';
<p>Use the v-model directive to enable two-way binding.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrderList v-model="cars" dataKey="vin" v-model:selection="selection"&gt;
&lt;template #header&gt;
List of Cars
@ -173,8 +170,7 @@ import OrderList from 'primevue/orderlist';
</a>
<LiveEditor name="OrderListDemo" :sources="sources" service="ProductService" data="products-small" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrderList v-model="products" listStyle="height:auto" dataKey="id"&gt;
&lt;template #header&gt;
List of Products
@ -199,8 +195,7 @@ import OrderList from 'primevue/orderlist';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {
@ -220,8 +215,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.product-item {
display: flex;
align-items: center;

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import OrganizationChart from 'primevue/organizationchart';
</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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrganizationChart :value="data"&gt;
&lt;template #default="slotProps"&gt;
&lt;span&gt;&#123;&#123;slotProps.node.data.label&#125;&#125;&lt;/span&gt;
@ -21,8 +19,7 @@ import OrganizationChart from 'primevue/organizationchart';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -132,8 +129,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrganizationChart :value="data" :collapsible="true" :collapsedKeys="collapsedKeys"&gt;
&lt;template #default="slotProps"&gt;
&lt;span&gt;&#123;&#123;slotProps.node.data.label&#125;&#125;&lt;/span&gt;
@ -142,8 +138,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -193,8 +188,7 @@ export default {
<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 v-model directive. Note that
selection on a particular node can be disabled if the <i>selectable</i> is false on the node instance.</p>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrganizationChart :value="data" selecionMode="single" v-model:selectionKeys="selectionKeys"&gt;
&lt;template #default="slotProps"&gt;
&lt;span&gt;&#123;&#123;slotProps.node.data.label&#125;&#125;&lt;/span&gt;
@ -203,8 +197,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -252,8 +245,7 @@ export default {
<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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;OrganizationChart :value="data"&gt;
&lt;template #person="slotProps"&gt;
&lt;div class="node-header ui-corner-top"&gt;&#123;&#123;slotProps.node.data.label&#125;&#125;&lt;/div&gt;
@ -269,8 +261,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -496,8 +487,7 @@ export default {
</a>
<LiveEditor name="OrganizationChartDemo" :sources="sources" :toastService="true" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h3&gt;Advanced&lt;/h3&gt;
&lt;OrganizationChart :value="data1" :collapsible="true" class="company" selectionMode="single" v-model:selectionKeys="selection"
@node-select="onNodeSelect" @node-unselect="onNodeUnselect" @node-collapse="onNodeCollapse" @node-expand="onNodeExpand"&gt;
@ -522,8 +512,7 @@ export default {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -662,8 +651,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
::v-deep(.p-organizationchart) {
.p-person {
padding: 0;

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import OverlayPanel from 'primevue/overlaypanel';
</code></pre>
<h5>Getting Started</h5>
<p>OverlayPanel is accessed via its reference where visibility is controlled using toggle, show and hide methods.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Button type="button" label="Toggle" @click="toggle" /&gt;
&lt;OverlayPanel ref="op"&gt;
@ -21,8 +19,7 @@ import OverlayPanel from 'primevue/overlaypanel';
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
toggle(event) {
this.$refs.op.toggle(event);
}
@ -32,8 +29,7 @@ toggle(event) {
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;OverlayPanel ref="op" :showCloseIcon="true" :dismissable="true"&gt;
&lt;img src="demo/images/nature/nature1.jpg" alt="Nature Image"&gt;
&lt;/OverlayPanel&gt;
@ -161,8 +157,7 @@ toggle(event) {
</a>
<LiveEditor name="OverlayPanelDemo" :sources="sources" service="ProductService" data="products-small" :toastService="true" :components="['Button', 'DataTable', 'Column']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Button type="button" icon="pi pi-search" :label="selectedProduct ? selectedProduct.name : 'Select a Product'" @click="toggle" aria:haspopup="true" aria-controls="overlay_panel" /&gt;
&lt;OverlayPanel ref="op" appendTo="body" :showCloseIcon="true" id="overlay_panel" style="width: 450px"&gt;
@ -183,8 +178,7 @@ toggle(event) {
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
import ProductService from '../../service/ProductService';
export default {

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Paginator from 'primevue/paginator';
</code></pre>
<h5>Getting Started</h5>
<p><i>rows</i> and <i>totalRecords</i> are the required properties of the Paginator.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator :rows="10" :totalRecords="totalItemsCount"&gt;&lt;/Paginator&gt;
</code></pre>
@ -20,31 +18,27 @@ import Paginator from 'primevue/paginator';
<h5>Start Index</h5>
<p><i>first</i> property defines the index of the first item displayed by the paginator.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator :first="offset" :rows="10" :totalRecords="totalItemsCount"&gt;&lt;/Paginator&gt;
</code></pre>
<p>Use the v-model directive to enable two-way binding, this is useful in cases where you need to programmatically control the paginator.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator v-model:first="offset" :rows="10" :totalRecords="totalItemsCount"&gt;&lt;/Paginator&gt;
</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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator v-model:first="offset" :rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"&gt;&lt;/Paginator&gt;
</code></pre>
<p>As <i>rows</i> also change when the dropdown changes, use the optional v-model directive if you need two-way binding.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator v-model:first="offset" v-model:rows="rows" :totalRecords="totalItemsCount" :rowsPerPageOptions="[10,20,30]"&gt;&lt;/Paginator&gt;
</code></pre>
@ -81,8 +75,7 @@ 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>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;Paginator v-model:first="offset" :rows="10" :totalRecords="totalItemsCount"&gt;
&lt;template #left="slotProps"&gt;
Page: &#123;&#123;slotProps.state.page&#125;&#125;
@ -98,14 +91,12 @@ import Paginator from 'primevue/paginator';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;Paginator :rows="10" :totalRecords="totalItemsCount" @page="onPage($event)"&gt;&lt;/Paginator&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
onPage(event) {
//event.page: New page number
//event.first: Index of first record
@ -263,8 +254,7 @@ onPage(event) {
</a>
<LiveEditor name="PaginatorDemo" :sources="sources" :components="['Button']" />
</div>
<pre v-code>
<code>
<pre v-code><code>
&lt;h3&gt;Basic&lt;/h3&gt;
&lt;Paginator :rows="10" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"&gt;&lt;/Paginator&gt;
@ -285,8 +275,7 @@ onPage(event) {
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -309,8 +298,7 @@ export default {
</code></pre>
<pre v-code.css>
<code>
<pre v-code.css><code>
.p-button.p-button-icon-only {
border-radius: 0;
}

View File

@ -3,16 +3,14 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import Panel from 'primevue/panel';
</code></pre>
<h5>Getting Started</h5>
<p>Panel is a container component that accepts content as its children.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Panel header="Header"&gt;
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.
@ -24,8 +22,7 @@ import Panel from 'primevue/panel';
<h5>Custom Header</h5>
<p>Header of the panel is either defined with the <i>header</i> property or the header template.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Panel&gt;
&lt;template #header&gt;
Header Content
@ -37,8 +34,7 @@ import Panel from 'primevue/panel';
<h5>Toggleable</h5>
<p>Content of the panel can be expanded and collapsed using <i>toggleable</i> option.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Panel header="Header" :toggleable="true"&gt;
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.
@ -49,8 +45,7 @@ import Panel from 'primevue/panel';
</code></pre>
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;Panel header="Header Text" :toggleable="true" :collapsed="true"&gt;
Content
&lt;/Panel&gt;
@ -59,8 +54,7 @@ import Panel from 'primevue/panel';
<p>Use the v-model directive to enable two-way binding.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically&lt;/button&gt;
&lt;Panel header="Header Text" :toggleable="true" v-model:collapsed="isCollapsed"&gt;
Content
@ -71,8 +65,7 @@ import Panel from 'primevue/panel';
<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>
<pre v-code>
<code>
<pre v-code><code>
&lt;h5&gt;Advanced&lt;/h5&gt;
&lt;Panel header="Header"&gt;
&lt;template #icons&gt;
@ -193,8 +186,7 @@ import Panel from 'primevue/panel';
<LiveEditor name="PanelDemo" :sources="sources" :toastService="true" :components="['Menu']" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;h5&gt;Regular&lt;/h5&gt;
&lt;Panel header="Header"&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
@ -219,8 +211,7 @@ import Panel from 'primevue/panel';
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

View File

@ -3,8 +3,7 @@
<TabView>
<TabPanel header="Documentation">
<h5>Import</h5>
<pre v-code.script>
<code>
<pre v-code.script><code>
import PanelMenu from 'primevue/panelmenu';
</code></pre>
@ -14,14 +13,12 @@ import PanelMenu from 'primevue/panelmenu';
<h5>Getting Started</h5>
<p>PanelMenu requires a collection of menuitems as its model.</p>
<pre v-code>
<code>
<pre v-code><code>
&lt;PanelMenu :model="items" /&gt;
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {
@ -229,14 +226,12 @@ export default {
</a>
<LiveEditor name="PanelMenuDemo" :sources="sources" :router="true" />
</div>
<pre v-code>
<code><template v-pre>
<pre v-code><code><template v-pre>
&lt;PanelMenu :model="items" /&gt;
</template>
</code></pre>
<pre v-code.script>
<code>
<pre v-code.script><code>
export default {
data() {
return {

Some files were not shown because too many files have changed in this diff Show More