primevue-mirror/doc/theming/unstyled/ExampleDoc.vue

72 lines
2.3 KiB
Vue
Raw Normal View History

2023-07-09 21:13:49 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
Here is a sample that provides a style using PrimeFlex CSS library. Before beginning, head over to the pass through section <NuxtLink to="/button">button</NuxtLink> documentation to learn more about the components internals. We'll be
using the <i>root</i>, <i>label</i> and <i>icon</i> elements to add a custom style.
</p>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2023-07-09 21:13:49 +00:00
<Button
label="Check"
icon="pi pi-check"
unstyled
:pt="{
2024-05-20 12:14:38 +00:00
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-4 rounded border-0 flex gap-2' },
2023-07-09 21:13:49 +00:00
label: { class: 'text-white font-bold text-xl' },
2023-07-11 23:14:34 +00:00
icon: 'text-white text-2xl'
2023-07-09 21:13:49 +00:00
}"
/>
</div>
<DocSectionCode :code="code" />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Button label="Check" icon="pi pi-check" unstyled
2023-07-09 21:13:49 +00:00
:pt="{
2024-05-20 12:14:38 +00:00
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-4 rounded border-0 flex gap-2' },
2023-07-09 21:13:49 +00:00
label: { class: 'text-white font-bold text-xl' },
2023-07-11 23:14:34 +00:00
icon: 'text-white text-2xl' // OR { class: 'text-white text-2xl' }
2023-07-09 21:13:49 +00:00
}"
2023-10-15 09:38:39 +00:00
/>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-07-09 21:13:49 +00:00
<div class="card">
<Button label="Check" icon="pi pi-check" unstyled
:pt="{
2024-05-20 12:14:38 +00:00
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-4 rounded border-0 flex gap-2' },
2023-07-09 21:13:49 +00:00
label: { class: 'text-white font-bold text-xl' },
2023-07-11 23:14:34 +00:00
icon: 'text-white text-2xl' // OR { class: 'text-white text-2xl' }
2023-07-09 21:13:49 +00:00
}"
/>
</div>
</template>
<script>
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-07-09 21:13:49 +00:00
<Button label="Check" icon="pi pi-check" unstyled
:pt="{
2024-05-20 12:14:38 +00:00
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-4 rounded border-0 flex gap-2' },
2023-07-09 21:13:49 +00:00
label: { class: 'text-white font-bold text-xl' },
2023-07-11 23:14:34 +00:00
icon: 'text-white text-2xl' // OR { class: 'text-white text-2xl' }
2023-07-09 21:13:49 +00:00
}"
/>
</template>
<script setup>
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-07-09 21:13:49 +00:00
}
};
}
};
</script>