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

82 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: {
basic: `
<Checkbox
v-model="checked"
binary
:pt="{
input: ({ props, state }) => ({
class: state.focused ? 'border-orange-400' : undefined
})
}"
/>`,
options: `
<template>
<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
};
}
};
<\/script>`,
composition: `
<template>
<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);
<\/script>`
}
};
}
};
</script>