mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Convert to PrimeVue monorepo
This commit is contained in:
parent
970ba75b06
commit
61929eae75
4144 changed files with 59008 additions and 36177 deletions
90
apps/showcase/doc/radiobutton/DynamicDoc.vue
Normal file
90
apps/showcase/doc/radiobutton/DynamicDoc.vue
Normal file
|
@ -0,0 +1,90 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>RadioButtons can be generated using a list of values.</p>
|
||||
</DocSectionText>
|
||||
<div class="card flex justify-center">
|
||||
<div class="flex flex-col gap-4">
|
||||
<div v-for="category in categories" :key="category.key" class="flex items-center">
|
||||
<RadioButton v-model="selectedCategory" :inputId="category.key" name="dynamic" :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 {
|
||||
categories: [
|
||||
{ name: 'Accounting', key: 'A' },
|
||||
{ name: 'Marketing', key: 'M' },
|
||||
{ name: 'Production', key: 'P' },
|
||||
{ name: 'Research', key: 'R' }
|
||||
],
|
||||
selectedCategory: 'Production',
|
||||
code: {
|
||||
basic: `
|
||||
<div v-for="category in categories" :key="category.key" class="flex items-center">
|
||||
<RadioButton v-model="selectedCategory" :inputId="category.key" name="dynamic" :value="category.name" />
|
||||
<label :for="category.key" class="ml-2">{{ category.name }}</label>
|
||||
</div>
|
||||
`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-center">
|
||||
<div class="flex flex-col gap-4">
|
||||
<div v-for="category in categories" :key="category.key" class="flex items-center">
|
||||
<RadioButton v-model="selectedCategory" :inputId="category.key" name="dynamic" :value="category.name" />
|
||||
<label :for="category.key" class="ml-2">{{ category.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedCategory: 'Production',
|
||||
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-center">
|
||||
<div class="flex flex-col gap-4">
|
||||
<div v-for="category in categories" :key="category.key" class="flex items-center">
|
||||
<RadioButton v-model="selectedCategory" :inputId="category.key" name="dynamic" :value="category.name" />
|
||||
<label :for="category.key" class="ml-2">{{ category.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const selectedCategory = ref('Production');
|
||||
const categories = ref([
|
||||
{ name: 'Accounting', key: 'A' },
|
||||
{ name: 'Marketing', key: 'M' },
|
||||
{ name: 'Production', key: 'P' },
|
||||
{ name: 'Research', key: 'R' }
|
||||
]);
|
||||
<\/script>
|
||||
`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue