2023-08-06 14:52:53 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>
|
|
|
|
PrimeVue offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the
|
2023-08-07 12:40:22 +00:00
|
|
|
<PrimeVueNuxtLink to="/tailwind">Tailwind Customization</PrimeVueNuxtLink> section for an example.
|
2023-08-06 14:52:53 +00:00
|
|
|
</p>
|
|
|
|
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz />
|
|
|
|
<p>A playground sample with the pre-built Tailwind theme.</p>
|
|
|
|
<DocSectionCode :code="code2" embedded />
|
|
|
|
</DocSectionText>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
code1: {
|
|
|
|
basic: `
|
|
|
|
export const TRANSITIONS = {
|
|
|
|
toggleable: {
|
|
|
|
enterFromClass: 'max-h-0',
|
|
|
|
enterActiveClass: 'overflow-hidden transition-all duration-500 ease-in-out',
|
|
|
|
enterToClass: 'max-h-40 ',
|
|
|
|
leaveFromClass: 'max-h-40',
|
|
|
|
leaveActiveClass: 'overflow-hidden transition-all duration-500 ease-in',
|
|
|
|
leaveToClass: 'max-h-0'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
panel: {
|
|
|
|
header: ({ props }) => ({
|
|
|
|
class: [
|
|
|
|
'flex items-center justify-between', // flex and alignments
|
|
|
|
'border border-gray-300 bg-gray-100 text-gray-700 rounded-tl-lg rounded-tr-lg', // borders and colors
|
|
|
|
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80', // Dark mode
|
|
|
|
{ 'p-5': !props.toggleable, 'py-3 px-5': props.toggleable } // condition
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
title: 'leading-none font-bold',
|
|
|
|
toggler: {
|
|
|
|
class: [
|
|
|
|
'inline-flex items-center justify-center overflow-hidden relative no-underline', // alignments
|
|
|
|
'w-8 h-8 text-gray-600 border-0 bg-transparent rounded-full transition duration-200 ease-in-out', // widths, borders, and transitions
|
|
|
|
'hover:text-gray-900 hover:border-transparent hover:bg-gray-200 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]', // hover
|
|
|
|
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]' // focus
|
|
|
|
]
|
|
|
|
},
|
|
|
|
togglerIcon: 'inline-block',
|
|
|
|
content: {
|
|
|
|
class: [
|
|
|
|
'p-5 border border-gray-300 bg-white text-gray-700 border-t-0 last:rounded-br-lg last:rounded-bl-lg',
|
|
|
|
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
|
|
|
|
]
|
|
|
|
},
|
|
|
|
transition: TRANSITIONS.toggleable
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
},
|
|
|
|
code2: {
|
|
|
|
composition: `
|
|
|
|
<template>
|
|
|
|
<div class="card">
|
|
|
|
<Panel header="Header">
|
|
|
|
<p class="m-0">
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
|
|
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
|
|
</p>
|
|
|
|
</Panel>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<\/script>`
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|