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 const TRANSITIONS = {
|
2023-08-07 11:27:39 +00:00
|
|
|
overlay: {
|
|
|
|
enterFromClass: 'opacity-0 scale-75',
|
|
|
|
enterActiveClass: 'transition-transform transition-opacity duration-150 ease-in',
|
|
|
|
leaveActiveClass: 'transition-opacity duration-150 ease-linear',
|
|
|
|
leaveToClass: 'opacity-0'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
password: {
|
|
|
|
root: ({ props }) => ({
|
|
|
|
class: [
|
|
|
|
'inline-flex relative',
|
|
|
|
{
|
|
|
|
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
panel: 'p-5 bg-white dark:bg-gray-900 text-gray-700 dark:text-white/80 shadow-md rounded-md',
|
|
|
|
meter: 'mb-2 bg-gray-300 dark:bg-gray-700 h-3',
|
|
|
|
meterlabel: ({ instance, props }) => ({
|
|
|
|
class: [
|
|
|
|
'transition-width duration-1000 ease-in-out h-full',
|
|
|
|
{
|
|
|
|
'bg-red-500': instance?.meter?.strength == 'weak',
|
|
|
|
'bg-orange-500': instance?.meter?.strength == 'medium',
|
|
|
|
'bg-green-500': instance?.meter?.strength == 'strong'
|
|
|
|
},
|
|
|
|
{ 'pr-[2.5rem] ': props.toggleMask }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
showicon: {
|
|
|
|
class: ['absolute top-1/2 -mt-2', 'right-3 text-gray-600 dark:text-white/70']
|
|
|
|
},
|
|
|
|
hideicon: {
|
|
|
|
class: ['absolute top-1/2 -mt-2', 'right-3 text-gray-600 dark:text-white/70']
|
|
|
|
},
|
|
|
|
transition: TRANSITIONS.overlay
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
},
|
|
|
|
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">
|
|
|
|
<Password v-model="value" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
const value = ref(null);
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-08-07 11:27:39 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|