61 lines
2.4 KiB
Vue
61 lines
2.4 KiB
Vue
<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>
|
|
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz scrollable />
|
|
<p class="mt-4">A playground sample with the pre-built Tailwind theme.</p>
|
|
<DocSectionCode :code="code2" embedded />
|
|
</DocSectionText>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
code1: {
|
|
basic: `export default {
|
|
selectbutton: {
|
|
root: ({ props }) => ({
|
|
class: [{ 'opacity-60 select-none pointer-events-none cursor-default': props.disabled }]
|
|
}),
|
|
button: ({ context }) => ({
|
|
class: [
|
|
'inline-flex cursor-pointer select-none items-center align-bottom text-center overflow-hidden relative',
|
|
'px-4 py-3',
|
|
'transition duration-200 border border-r-0',
|
|
'first:rounded-l-md first:rounded-tr-none first:rounded-br-none last:border-r last:rounded-tl-none last:rounded-bl-none last:rounded-r-md',
|
|
'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)]',
|
|
{
|
|
'bg-white dark:bg-gray-900 text-gray-700 dark:text-white/80 border-gray-300 dark:border-blue-900/40 hover:bg-gray-50 dark:hover:bg-gray-800/80 ': !context.active,
|
|
'bg-blue-500 border-blue-500 text-white hover:bg-blue-600': context.active,
|
|
'opacity-60 select-none pointer-events-none cursor-default': context.disabled
|
|
}
|
|
]
|
|
}),
|
|
label: 'font-bold'
|
|
}
|
|
}
|
|
`
|
|
},
|
|
code2: {
|
|
composition: `
|
|
<template>
|
|
<div class="card flex justify-center">
|
|
<SelectButton v-model="value" :options="options" aria-labelledby="basic" />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
|
|
const value = ref('Off');
|
|
const options = ref(['Off', 'On']);
|
|
<\/script>`
|
|
}
|
|
};
|
|
}
|
|
};
|
|
</script>
|