mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Merged new Docs and Demos
This commit is contained in:
parent
296cc217fb
commit
dfcc8ef4e7
1235 changed files with 130757 additions and 122640 deletions
87
doc/checkbox/DynamicDoc.vue
Normal file
87
doc/checkbox/DynamicDoc.vue
Normal file
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>Checkboxes can be generated using a list of values.</p>
|
||||
</DocSectionText>
|
||||
<div class="card flex justify-content-center">
|
||||
<div class="flex flex-column gap-3">
|
||||
<div v-for="category of categories" :key="category.key" class="flex align-items-center">
|
||||
<Checkbox v-model="selectedCategories" :inputId="category.key" name="category" :value="category.name" />
|
||||
<label :for="category.key" class="ml-2">{{ category.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedCategories: ['Marketing'],
|
||||
categories: [
|
||||
{ name: 'Accounting', key: 'A' },
|
||||
{ name: 'Marketing', key: 'M' },
|
||||
{ name: 'Production', key: 'P' },
|
||||
{ name: 'Research', key: 'R' }
|
||||
],
|
||||
code: {
|
||||
basic: `
|
||||
<div v-for="category of categories" :key="category.key" class="flex align-items-center">
|
||||
<Checkbox v-model="selectedCategories" :inputId="category.key" name="category" :value="category.name" />
|
||||
<label :for="category.key">{{ category.name }}</label>
|
||||
</div>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-content-center">
|
||||
<div class="flex flex-column gap-3">
|
||||
<div v-for="category of categories" :key="category.key" class="flex align-items-center">
|
||||
<Checkbox v-model="selectedCategories" :inputId="category.key" name="category" :value="category.name" />
|
||||
<label :for="category.key">{{ category.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedCategories: ['Marketing'],
|
||||
categories: [
|
||||
{ name: "Accounting", key: "A" },
|
||||
{ name: "Marketing", key: "M" },
|
||||
{ name: "Production", key: "P" },
|
||||
{ name: "Research", key: "R" }
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card flex justify-content-center">
|
||||
<div class="flex flex-column gap-3">
|
||||
<div v-for="category of categories" :key="category.key" class="flex align-items-center">
|
||||
<Checkbox v-model="selectedCategories" :inputId="category.key" name="category" :value="category.name" />
|
||||
<label :for="category.key">{{ category.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const categories = ref([
|
||||
{name: "Accounting", key: "A"},
|
||||
{name: "Marketing", key: "M"},
|
||||
{name: "Production", key: "P"},
|
||||
{name: "Research", key: "R"}
|
||||
]);
|
||||
const selectedCategories = ref(['Marketing']);
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue