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

85 lines
1.7 KiB
Vue
Raw Normal View History

2023-05-05 09:10:17 +00:00
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
checked: false,
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Checkbox
2023-05-05 09:10:17 +00:00
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
2023-10-15 06:00:52 +00:00
/>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-05-05 09:10:17 +00:00
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
checked: false
};
}
};
2023-10-15 06:00:52 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-05-05 09:10:17 +00:00
<div class="card flex justify-content-center">
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const checked = ref(false);
2023-10-15 06:00:52 +00:00
<\/script>
`
2023-05-05 09:10:17 +00:00
}
};
}
};
</script>