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 06:00:52 +00:00
|
|
|
basic: `
|
|
|
|
export default {
|
2023-08-07 11:27:39 +00:00
|
|
|
checkbox: {
|
|
|
|
root: {
|
|
|
|
class: ['cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6']
|
|
|
|
},
|
|
|
|
input: ({ props, context }) => ({
|
|
|
|
class: [
|
|
|
|
'flex items-center justify-center',
|
|
|
|
'border-2 w-6 h-6 text-gray-600 rounded-lg transition-colors duration-200',
|
|
|
|
{
|
|
|
|
'border-gray-300 bg-white dark:border-blue-900/40 dark:bg-gray-900': !context.checked,
|
|
|
|
'border-blue-500 bg-blue-500 dark:border-blue-400 dark:bg-blue-400': context.checked
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'hover:border-blue-500 dark:hover:border-blue-400 focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]': !props.disabled,
|
|
|
|
'cursor-default opacity-60': props.disabled
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
icon: 'w-4 h-4 transition-all duration-200 text-white text-base dark:text-gray-900'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
},
|
|
|
|
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">
|
|
|
|
<Checkbox v-model="checked" :binary="true" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const checked = ref(false);
|
2023-10-15 06:00:52 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-08-07 11:27:39 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|