primevue-mirror/doc/selectbutton/pt/PTDoc.vue

89 lines
2.0 KiB
Vue
Raw Normal View History

2023-05-06 19:56:50 +00:00
<template>
<DocSectionText v-bind="$attrs"> </DocSectionText>
<div class="card flex justify-content-center">
<SelectButton
v-model="value"
:options="options"
aria-labelledby="basic"
:pt="{
2023-05-09 09:18:10 +00:00
button: ({ context }) => ({
class: context.active ? 'bg-cyan-400 border-cyan-400' : undefined
2023-05-08 12:32:33 +00:00
})
2023-05-06 19:56:50 +00:00
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: 'Off',
options: ['Off', 'On'],
code: {
basic: `
2023-05-08 12:32:33 +00:00
<SelectButton
v-model="value"
:options="options"
aria-labelledby="basic"
:pt="{
2023-05-09 09:18:10 +00:00
button: ({ context }) => ({
class: context.active ? 'bg-cyan-400 border-cyan-400' : undefined
2023-05-08 12:32:33 +00:00
})
2023-05-09 09:18:10 +00:00
}"
/>`,
2023-05-06 19:56:50 +00:00
options: `
<template>
<div class="card flex justify-content-center">
2023-05-08 12:32:33 +00:00
<SelectButton
v-model="value"
:options="options"
aria-labelledby="basic"
:pt="{
2023-05-09 09:18:10 +00:00
button: ({ context }) => ({
class: context.active ? 'bg-cyan-400 border-cyan-400' : undefined
2023-05-08 12:32:33 +00:00
})
}"
/>
2023-05-06 19:56:50 +00:00
</div>
</template>
<script>
export default {
data() {
return {
value: 'off',
options: ['Off', 'On']
}
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
2023-05-08 12:32:33 +00:00
<SelectButton
v-model="value"
:options="options"
aria-labelledby="basic"
:pt="{
2023-05-09 09:18:10 +00:00
button: ({ context }) => ({
class: context.active ? 'bg-cyan-400 border-cyan-400' : undefined
2023-05-08 12:32:33 +00:00
})
}"
/>
2023-05-06 19:56:50 +00:00
</div>
</template>
<script setup>
import { ref } from 'vue';
const value = ref('off');
const options = ref(['Off', 'On']);
<\/script>`
}
};
}
};
</script>