2023-08-07 11:27:39 +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
|
|
|
|
<PrimeVueNuxtLink to="/tailwind">Tailwind Customization</PrimeVueNuxtLink> section for an example.
|
|
|
|
</p>
|
2023-09-22 12:54:14 +00:00
|
|
|
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz scrollable />
|
2023-08-16 13:58:31 +00:00
|
|
|
<p class="mt-4">A playground sample with the pre-built Tailwind theme.</p>
|
2023-08-07 11:27:39 +00:00
|
|
|
<DocSectionCode :code="code2" embedded />
|
|
|
|
</DocSectionText>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
code1: {
|
2023-10-15 09:38:39 +00:00
|
|
|
basic: `
|
|
|
|
export default {
|
2023-08-07 11:27:39 +00:00
|
|
|
listbox: {
|
|
|
|
root: {
|
|
|
|
class: ['bg-white dark:bg-gray-900 border border-gray-400 dark:border-blue-900/40 transition-colors duration-200 ease-in-out rounded-md', 'w-full md:w-56']
|
|
|
|
},
|
2023-10-18 06:58:43 +00:00
|
|
|
wrapper: {
|
|
|
|
class: 'overflow-auto'
|
|
|
|
},
|
|
|
|
list: {
|
|
|
|
class: 'py-3 list-none m-0'
|
|
|
|
},
|
2023-08-07 11:27:39 +00:00
|
|
|
item: ({ context }) => ({
|
|
|
|
class: [
|
|
|
|
'cursor-pointer font-normal overflow-hidden relative whitespace-nowrap',
|
|
|
|
'm-0 p-3 border-0 transition-shadow duration-200 rounded-none',
|
|
|
|
{
|
2023-10-18 06:58:43 +00:00
|
|
|
'text-gray-700 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': !context.focused && !context.selected,
|
|
|
|
'bg-gray-300 text-gray-700 dark:text-white/80 dark:bg-gray-800/90 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': context.focused && !context.selected,
|
|
|
|
'bg-blue-100 text-blue-700 dark:bg-blue-400 dark:text-white/80': context.focused && context.selected,
|
2023-08-07 11:27:39 +00:00
|
|
|
'bg-blue-50 text-blue-700 dark:bg-blue-300 dark:text-white/80': !context.focused && context.selected
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
itemgroup: {
|
|
|
|
class: ['m-0 p-3 text-gray-800 bg-white font-bold', 'dark:bg-gray-900 dark:text-white/80', 'cursor-auto']
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
class: ['p-3 border-b border-gray-300 text-gray-700 bg-gray-100 mt-0 rounded-tl-lg rounded-tr-lg', 'dark:bg-gray-800 dark:text-white/80 dark:border-blue-900/40']
|
|
|
|
},
|
2023-10-18 06:58:43 +00:00
|
|
|
filtercontainer: {
|
|
|
|
class: 'relative'
|
|
|
|
},
|
2023-08-07 11:27:39 +00:00
|
|
|
filterinput: {
|
|
|
|
class: [
|
|
|
|
'pr-7 -mr-7',
|
|
|
|
'w-full',
|
|
|
|
'font-sans text-base text-gray-700 bg-white py-3 px-3 border border-gray-300 transition duration-200 rounded-lg appearance-none',
|
|
|
|
'dark:bg-gray-900 dark:border-blue-900/40 dark:hover:border-blue-300 dark:text-white/80',
|
|
|
|
'hover:border-blue-500 focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]'
|
|
|
|
]
|
|
|
|
},
|
2023-10-18 06:58:43 +00:00
|
|
|
filtericon: {
|
|
|
|
class: '-mt-2 absolute top-1/2'
|
|
|
|
}
|
2023-08-07 11:27:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
},
|
|
|
|
code2: {
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-08-07 11:27:39 +00:00
|
|
|
<div class="card flex justify-center">
|
|
|
|
<Listbox v-model="selectedCity" :options="cities" optionLabel="name" class="w-full md:w-14rem" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const selectedCity = ref();
|
|
|
|
const cities = ref([
|
|
|
|
{ name: 'New York', code: 'NY' },
|
|
|
|
{ name: 'Rome', code: 'RM' },
|
|
|
|
{ name: 'London', code: 'LDN' },
|
|
|
|
{ name: 'Istanbul', code: 'IST' },
|
|
|
|
{ name: 'Paris', code: 'PRS' }
|
|
|
|
]);
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-08-07 11:27:39 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|