mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
InputSwitch pt demo added
This commit is contained in:
parent
10dc338ddf
commit
a13dcd38d3
4 changed files with 131 additions and 3 deletions
77
doc/inputswitch/pt/PTDoc.vue
Normal file
77
doc/inputswitch/pt/PTDoc.vue
Normal file
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs"></DocSectionText>
|
||||
<div class="card flex justify-content-center">
|
||||
<InputSwitch
|
||||
v-model="checked"
|
||||
:pt="{
|
||||
slider: ({ props }) => ({
|
||||
class: props.modelValue ? 'bg-teal-400' : 'bg-red-400'
|
||||
})
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checked: false,
|
||||
code: {
|
||||
basic: `
|
||||
<InputSwitch
|
||||
v-model="checked"
|
||||
:pt="{
|
||||
slider: ({ props }) => ({
|
||||
class: props.modelValue ? 'bg-teal-400' : 'bg-red-400'
|
||||
})
|
||||
}"
|
||||
/>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-content-center">
|
||||
<InputSwitch
|
||||
v-model="checked"
|
||||
:pt="{
|
||||
slider: ({ props }) => ({
|
||||
class: props.modelValue ? 'bg-teal-400' : 'bg-red-400'
|
||||
})
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checked: false
|
||||
}
|
||||
}
|
||||
};
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card flex justify-content-center">
|
||||
<InputSwitch
|
||||
v-model="checked"
|
||||
:pt="{
|
||||
slider: ({ props }) => ({
|
||||
class: props.modelValue ? 'bg-teal-400' : 'bg-red-400'
|
||||
})
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const checked = ref(false);
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue