primevue-mirror/apps/showcase/doc/drawer/TemplateDoc.vue

115 lines
4.7 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-05-25 13:52:39 +00:00
<p>Custom content at the header and footer sections is displayed with templating.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-04-18 14:22:30 +00:00
<Drawer v-model:visible="visible">
2023-02-28 08:29:30 +00:00
<template #header>
2024-05-20 12:14:38 +00:00
<div class="flex items-center gap-2">
2023-11-01 14:31:21 +00:00
<Avatar image="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" shape="circle" />
<span class="font-bold">Amy Elsner</span>
2023-02-28 08:29:30 +00:00
</div>
</template>
2023-11-01 14:31:21 +00:00
<p>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.</p>
2024-05-25 13:52:39 +00:00
<template #footer>
<div class="flex items-center gap-2">
<Button label="Account" icon="pi pi-user" class="flex-auto" outlined></Button>
<Button label="Logout" icon="pi pi-sign-out" class="flex-auto" severity="danger" text></Button>
</div>
</template>
2024-04-18 14:22:30 +00:00
</Drawer>
2023-02-28 08:29:30 +00:00
<Button icon="pi pi-plus" @click="visible = true" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
visible: false,
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-04-18 14:22:30 +00:00
<Drawer v-model:visible="visible">
2023-11-01 14:31:21 +00:00
<template #header>
2024-05-20 12:14:38 +00:00
<div class="flex items-center gap-2">
2023-11-01 14:31:21 +00:00
<Avatar image="/images/avatar/amyelsner.png" shape="circle" />
<span class="font-bold">Amy Elsner</span>
</div>
</template>
<p>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.</p>
2024-05-25 13:52:39 +00:00
<template #footer>
<div class="flex items-center gap-2">
<Button label="Account" icon="pi pi-user" class="flex-auto" outlined></Button>
<Button label="Logout" icon="pi pi-sign-out" class="flex-auto" severity="danger" text></Button>
</div>
</template>
2024-04-18 14:22:30 +00:00
</Drawer>
2023-11-01 14:31:21 +00:00
<Button icon="pi pi-plus" @click="visible = true" />
2023-10-15 09:38:39 +00:00
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-04-18 14:22:30 +00:00
<Drawer v-model:visible="visible">
2023-02-28 08:29:30 +00:00
<template #header>
2024-05-20 12:14:38 +00:00
<div class="flex items-center gap-2">
2023-11-01 14:31:21 +00:00
<Avatar image="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" shape="circle" />
<span class="font-bold">Amy Elsner</span>
2023-02-28 08:29:30 +00:00
</div>
</template>
2023-11-01 14:31:21 +00:00
<p>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.</p>
2024-05-25 13:52:39 +00:00
<template #footer>
<div class="flex items-center gap-2">
<Button label="Account" icon="pi pi-user" class="flex-auto" outlined></Button>
<Button label="Logout" icon="pi pi-sign-out" class="flex-auto" severity="danger" text></Button>
</div>
</template>
2024-04-18 14:22:30 +00:00
</Drawer>
2023-02-28 08:29:30 +00:00
<Button icon="pi pi-plus" @click="visible = true" />
</div>
</template>
<script>
export default {
data() {
return {
visible: false
}
}
}
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-04-18 14:22:30 +00:00
<Drawer v-model:visible="visible">
2023-02-28 08:29:30 +00:00
<template #header>
2024-05-20 12:14:38 +00:00
<div class="flex items-center gap-2">
2023-11-01 14:31:21 +00:00
<Avatar image="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" shape="circle" />
<span class="font-bold">Amy Elsner</span>
2023-02-28 08:29:30 +00:00
</div>
</template>
2023-11-20 07:48:32 +00:00
<p>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.</p>
2024-05-25 13:52:39 +00:00
<template #footer>
<div class="flex items-center gap-2">
<Button label="Account" icon="pi pi-user" class="flex-auto" outlined></Button>
<Button label="Logout" icon="pi pi-sign-out" class="flex-auto" severity="danger" text></Button>
</div>
</template>
2024-04-18 14:22:30 +00:00
</Drawer>
2023-02-28 08:29:30 +00:00
<Button icon="pi pi-plus" @click="visible = true" />
</div>
</template>
<script setup>
import { ref } from "vue";
const visible = ref(false);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>