Paginator Headless doc added

pull/6687/head
tugcekucukoglu 2024-10-30 12:11:55 +03:00
parent 5aeef7137d
commit 4645de417c
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,75 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Headless mode is enabled by defining a <i>container</i> slot that lets you implement entire UI instead of the default elements.</p>
</DocSectionText>
<div class="card">
<Paginator :rows="10" :totalRecords="120">
<template #container="{ first, last, prevCallback, nextCallback, totalRecords }">
<div class="flex items-center gap-2">
<Button icon="pi pi-chevron-left" severity="secondary" text @click="prevCallback" />
<div>Showing {{ first }} to {{ last }} of {{ totalRecords }}</div>
<Button icon="pi pi-chevron-right" severity="secondary" text @click="nextCallback" />
</div>
</template>
</Paginator>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
<Paginator :rows="10" :totalRecords="120">
<template #container="{ first, last, prevCallback, nextCallback, totalRecords }">
<div class="flex items-center gap-2">
<Button icon="pi pi-chevron-left" severity="secondary" text rounded @click="prevCallback" />
<div>Showing {{ first }} to {{ last }} of {{ totalRecords }}</div>
<Button icon="pi pi-chevron-right" severity="secondary" text rounded @click="nextCallback" />
</div>
</template>
</Paginator>
`,
options: `
<template>
<div class="card">
<Paginator :rows="10" :totalRecords="120">
<template #container="{ first, last, prevCallback, nextCallback, totalRecords }">
<div class="flex items-center gap-2">
<Button icon="pi pi-chevron-left" severity="secondary" text rounded @click="prevCallback" />
<div>Showing {{ first }} to {{ last }} of {{ totalRecords }}</div>
<Button icon="pi pi-chevron-right" severity="secondary" text rounded @click="nextCallback" />
</div>
</template>
</Paginator>
</div>
</template>
<script>
<\/script>
`,
composition: `
<template>
<div class="card">
<Paginator :rows="10" :totalRecords="120">
<template #container="{ first, last, prevCallback, nextCallback, totalRecords }">
<div class="flex items-center gap-2">
<Button icon="pi pi-chevron-left" severity="secondary" text rounded @click="prevCallback" />
<div>Showing {{ first }} to {{ last }} of {{ totalRecords }}</div>
<Button icon="pi pi-chevron-right" severity="secondary" text rounded @click="nextCallback" />
</div>
</template>
</Paginator>
</div>
</template>
<script setup>
<\/script>
`
}
};
}
};
</script>

View File

@ -58,6 +58,9 @@ export default defineNuxtConfig({
app: {
baseURL: baseUrl,
head: {
htmlAttrs: {
dir: 'rtl'
},
title: 'PrimeVue - Vue UI Component Library',
meta: [
{ charset: 'utf-8' },