InputSwitch pt demo added
parent
10dc338ddf
commit
a13dcd38d3
|
@ -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>
|
|
@ -0,0 +1,8 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>{{ $attrs.description }}</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<img class="w-full" src="https://primefaces.org/cdn/primevue/images/pt/wireframe-placeholder.jpg" />
|
||||
</div>
|
||||
</template>
|
|
@ -0,0 +1,41 @@
|
|||
<template>
|
||||
<div class="doc-main">
|
||||
<div class="doc-intro">
|
||||
<h1>InputSwitch Pass Through</h1>
|
||||
</div>
|
||||
<DocSections :docs="docs" />
|
||||
</div>
|
||||
<DocSectionNav :docs="docs" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DocApiTable from '@/components/doc/DocApiTable.vue';
|
||||
import { getPTOption } from '@/components/doc/helpers/PTHelper.js';
|
||||
import PtDoc from './PTDoc.vue';
|
||||
import PTImage from './PTImage.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
docs: [
|
||||
{
|
||||
id: 'pt.image',
|
||||
label: 'Wireframe',
|
||||
component: PTImage
|
||||
},
|
||||
{
|
||||
id: 'pt.doc.inputswitch',
|
||||
label: 'InputSwitch PT Options',
|
||||
component: DocApiTable,
|
||||
data: getPTOption('InputSwitch')
|
||||
},
|
||||
{
|
||||
id: 'pt.demo',
|
||||
label: 'Demo',
|
||||
component: PtDoc
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,16 +1,17 @@
|
|||
<template>
|
||||
<DocComponent title="Vue InputSwitch Component" header="InputSwitch" description="InputSwitch is used to select a boolean value." :componentDocs="docs" :apiDocs="['InputSwitch']" />
|
||||
<DocComponent title="Vue InputSwitch Component" header="InputSwitch" description="InputSwitch is used to select a boolean value." :componentDocs="docs" :apiDocs="['InputSwitch']" :ptTabComponent="ptComponent" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AccessibilityDoc from '@/doc/inputswitch/AccessibilityDoc.vue';
|
||||
import BasicDoc from '@/doc/inputswitch/BasicDoc.vue';
|
||||
import DisabledDoc from '@/doc/inputswitch/DisabledDoc.vue';
|
||||
import VeeValidateDoc from '@/doc/inputswitch/form/VeeValidateDoc.vue';
|
||||
import ImportDoc from '@/doc/inputswitch/ImportDoc.vue';
|
||||
import InvalidDoc from '@/doc/inputswitch/InvalidDoc.vue';
|
||||
import PreselectionDoc from '@/doc/inputswitch/PreselectionDoc.vue';
|
||||
import StyleDoc from '@/doc/inputswitch/StyleDoc.vue';
|
||||
import VeeValidateDoc from '@/doc/inputswitch/form/VeeValidateDoc.vue';
|
||||
import PTComponent from '@/doc/inputswitch/pt/index.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -63,7 +64,8 @@ export default {
|
|||
label: 'Accessibility',
|
||||
component: AccessibilityDoc
|
||||
}
|
||||
]
|
||||
],
|
||||
ptComponent: PTComponent
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue