From 4515bbd99b3ff3d41a378b89a49859d7ae496f52 Mon Sep 17 00:00:00 2001
From: Cagatay Civici Accordion element consists of one or more AccordionTab elements. Title of the tab is defined using header attribute. Visibility of the content is specified with the activeIndex property that supports one or two-way binding. Two-way binding requires v-model. 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. A tab can be disabled by setting the disabled property to true. Custom content for the title section of a panel is defined using the header template. Tabs can be controlled programmatically using activeIndex property. Tabs can be generated dynamically using the standard v-for directive. 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;Import
-
-
+
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
@@ -12,8 +11,7 @@ import AccordionTab from 'primevue/accordiontab';
Getting Started
-
+
<Accordion>
<AccordionTab header="Header I">
Content
@@ -30,8 +28,7 @@ import AccordionTab from 'primevue/accordiontab';
Active
-
+
<Accordion :activeIndex="0">
<AccordionTab header="Header I">
Content
@@ -47,8 +44,7 @@ import AccordionTab from 'primevue/accordiontab';
-
+
<Accordion v-model:activeIndex="activeIndex">
<AccordionTab header="Header I">
Content
@@ -66,8 +62,7 @@ import AccordionTab from 'primevue/accordiontab';
Multiple
-
+
<Accordion :multiple="true">
<AccordionTab header="Header I">
Content
@@ -84,8 +79,7 @@ import AccordionTab from 'primevue/accordiontab';
Disabled
-
+
<Accordion>
<AccordionTab header="Header I">
Content
@@ -102,8 +96,7 @@ import AccordionTab from 'primevue/accordiontab';
Custom Content at Headers
-
+
<Accordion>
<AccordionTab>
<template #header>
@@ -132,8 +125,7 @@ import AccordionTab from 'primevue/accordiontab';
Programmatic Control
-
+
-
<Button @click="active = 0" class="p-button-text" label="Activate 1st" />
<Button @click="active = 1" class="p-button-text" label="Activate 2nd" />
<Button @click="active = 2" class="p-button-text" label="Activate 3rd" />
@@ -152,8 +144,7 @@ import AccordionTab from 'primevue/accordiontab';
-
+
export default {
data() {
return {
@@ -166,8 +157,7 @@ export default {
Dynamic Tabs
-
+
-
<Accordion>
<AccordionTab v-for="tab in tabs" :key="tab.title" :header="tab.title">
<p>{{tab.content}}</p>
@@ -176,8 +166,7 @@ export default {
-
+
export default {
data() {
return {
@@ -322,8 +311,7 @@ export default {
-
+
-
<h5>Default</h5>
<Accordion :activeIndex="0">
<AccordionTab header="Header I">
@@ -430,8 +418,7 @@ export default {
-
+
-
export default {
data() {
return {
@@ -462,8 +449,7 @@ export default {
-
+
.accordion-custom {
i, span {
vertical-align: middle;
diff --git a/src/views/autocomplete/AutoCompleteDoc.vue b/src/views/autocomplete/AutoCompleteDoc.vue
index e1e34b9c1..5a3047a7a 100755
--- a/src/views/autocomplete/AutoCompleteDoc.vue
+++ b/src/views/autocomplete/AutoCompleteDoc.vue
@@ -3,8 +3,7 @@
Import
-
-
+
@@ -12,13 +11,11 @@ import AutoComplete from 'primevue/autocomplete';
import AutoComplete from 'primevue/autocomplete';
Getting Started
-
+
-
<AutoComplete v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountry($event)" field="name" />
-
+
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.
-
+
<AutoComplete v-model="brand" :dropdown="true" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" />
Multiple Mode
Multiple mode is enabled using multiple property to select more than one value from the autocomplete. In this case, value reference should be an array.
-
-
+
<AutoComplete :multiple="true" v-model="selectedCountries" :suggestions="filteredCountriesMultiple" @complete="searchCountryMultiple($event)" field="name" />
@@ -62,16 +57,14 @@ export default {
AutoComplete can also work with objects using the field property that defines the label to display
as a suggestion. The value passed to the model would still be the object instance of a suggestion.
Here is an example with a Country object that has name and code fields such as {name:"United States",code:"USA"}.
-
-
+
<AutoComplete field="label" v-model="selectedCountry" :suggestions="filteredCountriesBasic" @complete="searchCountryBasic($event)" />
Templating
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.
-
-
+
<AutoComplete v-model="brand" :suggestions="filteredBrands" @complete="searchBrand($event)" placeholder="Hint: type 'v' or 'f'" :dropdown="true">
<template #item="slotProps">
<img :alt="slotProps.item" :src="'demo/images/car/' + slotProps.item + '.png'" />
@@ -261,8 +254,7 @@ export default {
-
-
+
<h5>Basic</h5>
<AutoComplete v-model="selectedCountry1" :suggestions="filteredCountries" @complete="searchCountry($event)" field="name" />
@@ -283,8 +275,7 @@ export default {
-
-
+
import CountryService from '../../service/CountryService';
export default {
diff --git a/src/views/avatar/AvatarDoc.vue b/src/views/avatar/AvatarDoc.vue
index 78d6a23b3..966af8d02 100644
--- a/src/views/avatar/AvatarDoc.vue
+++ b/src/views/avatar/AvatarDoc.vue
@@ -3,8 +3,7 @@
Import
-
-
+
import Avatar from 'primevue/avatar';
import AvatarGroup from 'primevue/avatargroup';
@@ -12,8 +11,7 @@ import AvatarGroup from 'primevue/avatargroup';
Getting Started
Avatar has three built-in display modes; "label", "icon" and "image".
-
-
+
<Avatar label="P" />
<Avatar icon="pi pi-search" />
<Avatar image="user.png" />
@@ -22,16 +20,14 @@ import AvatarGroup from 'primevue/avatargroup';
Sizes
size property defines the size of the Avatar with "large" and "xlarge" as possible values.
-
-
+
<Avatar label="P" size="large"/>
AvatarGroup
A set of Avatars can be displayed together using the AvatarGroup component.
-
-
+
<AvatarGroup>
<Avatar label="P" />
<Avatar icon="pi pi-search" />
@@ -42,24 +38,21 @@ import AvatarGroup from 'primevue/avatargroup';
Shape
Avatar comes in two different styles specified with the shape property, "square" is the default and "circle" is the alternative.
-
-
+
<Avatar label="P" shape="circle"/>
Badge
A badge can be added to an Avatar with the Badge directive.
-
-
+
<Avatar image="user.png" size="xlarge" v-badge.danger="4" />
Templating
Content can easily be customized with the default slot instead of using the built-in modes.
-
-
+
<Avatar>
Content
</Avatar>
@@ -188,8 +181,7 @@ import AvatarGroup from 'primevue/avatargroup';
-
-
+
<div class="p-grid">
<div class="p-col-12 p-md-4">
<div class="card">
diff --git a/src/views/badge/BadgeDoc.vue b/src/views/badge/BadgeDoc.vue
index 5d1a54605..7af21ccb3 100644
--- a/src/views/badge/BadgeDoc.vue
+++ b/src/views/badge/BadgeDoc.vue
@@ -6,29 +6,25 @@
Badge can either be used as a standalone component or as a directive.
Component
-
-
+
import Badge from 'primevue/badge';
Content of the badge is specified using the value property.
-
-
+
<Badge value="2"></Badge>
Directive
-
-
+
import BadgeDirective from 'primevue/badgedirective';
When used as a directive, badge needs to be configured at the application with a name of your choice.
-
-
+
import BadgeDirective from 'primevue/badgedirective';
Vue.directive('badge', BadgeDirective);
@@ -36,8 +32,7 @@ Vue.directive('badge', BadgeDirective);
Next step is attaching it to an element.
-
-
+
<i class="pi pi-bell" v-badge="2"></i>
@@ -53,8 +48,7 @@ Vue.directive('badge', BadgeDirective);
danger
-
-
+
<Badge value="2" severity="success"></Badge>
<i class="pi pi-bell" v-badge.success="2"></i>
@@ -64,8 +58,7 @@ Vue.directive('badge', BadgeDirective);
Button Badges
Buttons provide integrated badge support with the badge and badgeClass properties.
-
-
+
<Button type="button" label="Emails" badge="8" />
<Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger" />
@@ -74,8 +67,7 @@ Vue.directive('badge', BadgeDirective);
Sizes
Badge sizes are adjusted with the size property that accepts "large" and "xlarge" as the possible alternatives to the default size. Currently
sizes only apply to component mode.
-
-
+
<Badge value="2"></Badge>
<Badge value="4" size="large" severity="warning"></Badge>
<Badge value="6" size="xlarge" severity="success"></Badge>
@@ -83,8 +75,7 @@ Vue.directive('badge', BadgeDirective);
In addition, when placed inside another element, badge sizes can also derive their size from their parent.
-
-
+
<h1>Heading 1 <Badge value="New"></Badge></h1>
<h2>Heading 2 <Badge value="New"></Badge></h2>
@@ -187,8 +178,7 @@ Vue.directive('badge', BadgeDirective);
-
-
+
<h5>Numbers</h5>
<Badge value="2" class="p-mr-2"></Badge>
<Badge value="8" severity="success" class="p-mr-2"></Badge>
diff --git a/src/views/blockui/BlockUIDoc.vue b/src/views/blockui/BlockUIDoc.vue
index 3747f5ce1..73df34860 100755
--- a/src/views/blockui/BlockUIDoc.vue
+++ b/src/views/blockui/BlockUIDoc.vue
@@ -3,8 +3,7 @@
Import
-
-
+
import BlockUI from 'primevue/blockui';
@@ -13,8 +12,7 @@ import BlockUI from 'primevue/blockui';
BlockUI is controlled using the blocked 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.
-
-
+
<BlockUI :blocked="blockedPanel">
<Panel header="Header">
Panel Content
@@ -23,8 +21,7 @@ import BlockUI from 'primevue/blockui';
-
-
+
export default {
data() {
return {
@@ -46,8 +43,7 @@ export default {
Full Screen
In full screen mode, instead of a particular element, the whole document gets blocked. Set fullScreen as true in order to enable this functionality.
-
-
+
<BlockUI :blocked="blockedDocument" :fullScreen="true"></BlockUI>
@@ -152,8 +148,7 @@ export default {
-
-
+
<h3>Document</h3>
<BlockUI :blocked="blockedDocument" :fullScreen="true"></BlockUI>
@@ -174,8 +169,7 @@ export default {
-
-
+
export default {
data() {
return {
diff --git a/src/views/breadcrumb/BreadcrumbDoc.vue b/src/views/breadcrumb/BreadcrumbDoc.vue
index f18db0c51..dffdf26ce 100755
--- a/src/views/breadcrumb/BreadcrumbDoc.vue
+++ b/src/views/breadcrumb/BreadcrumbDoc.vue
@@ -3,8 +3,7 @@
Import
-
-
+
import Breadcrumb from 'primevue/breadcrumb';
@@ -14,14 +13,12 @@ import Breadcrumb from 'primevue/breadcrumb';
Getting Started
Breadcrumb requires a collection of menuitems as its model and a home item.
-
-
+
<Breadcrumb :home="home" :model="items" />
-
-
+
export default {
data() {
return {
@@ -110,14 +107,12 @@ export default {
-
-
+
<Breadcrumb :home="home" :model="items" />
-
-
+
export default {
data() {
return {
diff --git a/src/views/button/ButtonDoc.vue b/src/views/button/ButtonDoc.vue
index f98b0963f..89cfcdef4 100755
--- a/src/views/button/ButtonDoc.vue
+++ b/src/views/button/ButtonDoc.vue
@@ -3,40 +3,35 @@
Import
-
-
+
import Button from 'primevue/button';
Getting Started
Button is created using the Button element.
-
-
+
<Button />
Label
Text of the button is defined using the label property.
-
-
+
<Button label="Submit" />
Icons
Icon on a button is specified with icon property and position is configured using iconPos attribute. Default
icon position is "left" and alternative is "right". To display only an icon, leave the label as undefined.
-
-
+
<Button label="Submit" icon="pi pi-check" iconPos="right" />
Events
Events are defined with the standard notation.
-
-
+
<Button label="Submit" @click="handleClick($event)"/>
@@ -53,8 +48,7 @@ import Button from 'primevue/button';
.p-button-danger
-
-
+
<Button label="Primary" />
<Button label="Secondary" class="p-button-secondary" />
<Button label="Success" class="p-button-success" />
@@ -68,8 +62,7 @@ import Button from 'primevue/button';
Text Buttons
Text buttons have transparent background and borders, use p-button-text to apply text button styling. In addition when used with .p-button-plain
text buttons ignore severity levels and displayed as a regular text.
-
-
+
<Button label="Submit" class="p-button-text" />
<Button icon="pi pi-check" class="p-button-text" />
<Button label="Cancel" icon="pi pi-times" class="p-button-text" />
@@ -79,24 +72,21 @@ import Button from 'primevue/button';
Raised and Rounded Buttons
A button can be raised by having "p-button-raised" style class and similarly borders can be made rounded using "p-button-rounded" class.
-
-
+
<Button label="Primary" class="p-button-raised p-button-rounded" />
Outlined Buttons
An alternate styling for a button is the outlined option where background becomes transparent. Apply "p-button-outlined" to style a button as outlined.
-
-
+
<Button label="Primary" class="p-button-outlined" />
Link Buttons
Use "p-button-link" class to render the button as a link.
-
-
+
<Button label="Link" class="p-button-link" />
@@ -104,8 +94,7 @@ import Button from 'primevue/button';
Badges
Badge is a small status indicator for a button. Refer to the badge documentation for available styling options.
-
-
+
<Button type="button" label="Emails" badge="8" />
<Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-info" />
@@ -113,8 +102,7 @@ import Button from 'primevue/button';
ButtonSet
Wrapping the buttons in a container having a .p-buttonset class, groups the buttons side to side.
-
-
+
<span class="p-buttonset">
<Button label="Save" icon="pi pi-check" />
<Button label="Delete" icon="pi pi-trash" />
@@ -126,8 +114,7 @@ import Button from 'primevue/button';
Sizes
2 more sizes are available in addition to a regular button, for a smaller input add p-button-sm and for a larger one, use p-button-lg.
Note that these classes available to change the size of a particular button, for global scaling see the theming page.
-
-
+
<Button label="Small" icon="pi pi-check" class="p-button-sm" />
<Button label="Normal" icon="pi pi-check" class="p-button" />
<Button label="Large" icon="pi pi-check" class="p-button-lg" />
@@ -136,8 +123,7 @@ import Button from 'primevue/button';
Slot
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.
-
-
+
<Button>
Custom Content
</Button>
@@ -237,8 +223,7 @@ import Button from 'primevue/button';
-
-
+
<h5>Basic</h5>
<Button label="Submit" />
<Button label="Disabled" disabled="disabled" />
@@ -353,8 +338,7 @@ import Button from 'primevue/button';
-
-
+
button {
margin-right: .5rem;
}
diff --git a/src/views/calendar/CalendarDoc.vue b/src/views/calendar/CalendarDoc.vue
index 6918dfd50..0c9383831 100755
--- a/src/views/calendar/CalendarDoc.vue
+++ b/src/views/calendar/CalendarDoc.vue
@@ -3,8 +3,7 @@
Import
-
-
+
import Calendar from 'primevue/calendar';
@@ -12,14 +11,12 @@ import Calendar from 'primevue/calendar';
Getting Started
Two-way value binding is defined using the standard v-model directive referencing to a Date property.
-
-
+
<Calendar v-model="value" />
-
-
+
export default {
data() {
return {
@@ -32,8 +29,7 @@ export default {
Popup and Inline
Calendar is displayed in a popup by default and inline property needs to be enabled for inline mode.
-
-
+
<Calendar v-model="value" :inline="true" />
@@ -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.
-
-
+
<Calendar v-model="value" selectionMode="single || multiple || range" />
@@ -53,8 +48,7 @@ export default {
DateFormat
Default date format is mm/dd/yy, to customize this use dateFormat property or define it at PrimeVue Locale globally. Note that standalone property overrides the value in locale settings.
-
-
+
<Calendar v-model="value" dateFormat="dd.mm.yy" />
@@ -84,8 +78,7 @@ export default {
TimePicker is enabled with showTime property and 24 (default) or 12 hour mode is configured using hourFormat option. If you
need to use the time picker as standalone, use the timeOnly property.
-
-
+
<Calendar v-model="value" :showTime="true" />
<Calendar v-model="value" :showTime="true" hourFormat="12" />
<Calendar v-model="value" :showTime="true" :timeOnly="true" />
@@ -95,31 +88,27 @@ export default {
Date Restriction
To disable entering dates manually, set manualInput to true and to restrict selectable dates with the minDate
and maxDate options.
-
-
+
<Calendar v-model="value" :minDate="minDateValue" maxDate="maxDateValue" />
To disable specific dates or days, restrict selectable dates use disabledDates and/or disabledDays options.
-
-
+
<Calendar v-model="value" :disabledDates="invalidDates" :disabledDays="[0,6]" />
Button Bar
Button bar displays today and clear buttons and enabled using showButtonBar property.
-
-
+
<Calendar v-model="value" :showButtonBar="true" />
Multiple Months
Displaying multiple months is enabled by setting numberOfMonths property to a value greater than 1.
-
-
+
<Calendar v-model="value" :numberOfMonths="3" />
@@ -130,8 +119,7 @@ export default {
Custom Content
Calendar UI accepts custom content using header and footer templates.
-
-
+
<Calendar v-model="value">
<template #header>Header Content</template>
<template #footer>Footer Content</template>
@@ -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.
-
-
+
<Calendar v-model="value">
<template #date="slotProps">
<strong v-if="slotProps.date.day > 10 && slotProps.date.day < 15" class="special-day">{{slotProps.date.day}}</strong>
@@ -154,8 +141,7 @@ export default {
-
-
+
.special-day {
text-decoration: line-through;
}
@@ -164,16 +150,14 @@ export default {
Month Picker
Month picker is used to select month and year only without the date, set view mode as "month" to activate month picker.
-
-
+
<Calendar v-model="value" view="month" dateFormat="mm/yy" :yearNavigator="true" yearRange="2000:2030" />
Touch UI
Touch UI mode displays the calendar overlay at the center of the screen as optimized for touch devices.
-
-
+
<Calendar v-model="value" :touchUI="true" />
@@ -552,8 +536,7 @@ export default {
-
-
+
<h5>Popup</h5>
<div class=" p-fluid p-grid p-formgrid">
<div class="p-field p-col-12 p-md-4">
@@ -628,8 +611,7 @@ export default {
-
-
+
export default {
created() {
let today = new Date();
@@ -677,8 +659,7 @@ export default {
-
-
+
.special-day {
text-decoration: line-through;
}
diff --git a/src/views/card/CardDoc.vue b/src/views/card/CardDoc.vue
index 0359b1e78..e388c6adc 100755
--- a/src/views/card/CardDoc.vue
+++ b/src/views/card/CardDoc.vue
@@ -3,16 +3,14 @@
Import
-
-
+
import Card from 'primevue/card';
Getting Started
Card provides header, title, subtitle, content and footer as the named templates to place content.
-
-
+
<Card>
<template #header>
<img alt="user header" src="demo/images/usercard.png">
@@ -78,8 +76,7 @@ import Card from 'primevue/card';
-
-
+
<Card style="width: 25rem; margin-bottom: 2em">
<template #title>
Simple Card
diff --git a/src/views/carousel/CarouselDoc.vue b/src/views/carousel/CarouselDoc.vue
index 75a8fee0b..e6b9ec34d 100755
--- a/src/views/carousel/CarouselDoc.vue
+++ b/src/views/carousel/CarouselDoc.vue
@@ -3,16 +3,14 @@
Import
-
-
+
import Carousel from 'primevue/carousel';
Getting Started
Carousel requires a collection of items as its value along with a template to render each item.
-
-
+
<Carousel :value="cars">
<template #item="slotProps">
</template>
@@ -22,8 +20,7 @@ import Carousel from 'primevue/carousel';
Items per page and Scroll Items
Number of items per page is defined using the numVisible property whereas number of items to scroll is defined with the numScroll property.
-
-
+
<Carousel :value="cars" :numVisible="3" :numScroll="1">
<template #item="slotProps">
</template>
@@ -34,8 +31,7 @@ import Carousel from 'primevue/carousel';
Responsive
For responsive design, numVisible and numScroll can be defined using the responsiveOptions property that should be an array of
objects whose breakpoint defines the max-width to apply the settings.
-
-
+
<Carousel :value="cars" :numVisible="4" :numScroll="3" :responsiveOptions="responsiveOptions">
<template #header>
<h2>Basic</h2>
@@ -62,8 +58,7 @@ import Carousel from 'primevue/carousel';
</Carousel>
-
-
+
data() {
return {
responsiveOptions: [
@@ -91,8 +86,7 @@ data() {
Header and Footer
Custom content projection is available using the header and footer templates.
-
-
+
<Carousel :value="cars" :numVisible="3" :numScroll="1" :responsiveOptions="responsiveOptions">
<template #header>
<h2>Custom Header</h2>
@@ -109,8 +103,7 @@ data() {
Orientation
Default layout of the Carousel is horizontal, other possible option is the vertical mode that is configured with the orientation property.
-
-
+