primevue-mirror/doc/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>
<div class="card flex justify-content-center">
<Button
label="Check"
icon="pi pi-check"
unstyled
:pt="{
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-3 border-round border-none flex gap-2' },
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="{
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-3 border-round border-none flex gap-2' },
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="{
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-3 border-round border-none flex gap-2' },
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="{
root: { class: 'bg-teal-500 hover:bg-teal-700 cursor-pointer text-white p-3 border-round border-none flex gap-2' },
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>