primevue-mirror/apps/showcase/doc/multiselect/IftaLabelDoc.vue

88 lines
2.7 KiB
Vue
Raw Normal View History

2024-09-20 09:28:05 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>IftaLabel is used to create infield top aligned labels. Visit <PrimeVueNuxtLink to="/iftalabel">IftaLabel</PrimeVueNuxtLink> documentation for more information.</p>
</DocSectionText>
<div class="card flex justify-center">
<IftaLabel class="w-full md:w-80">
2024-09-28 22:38:06 +00:00
<MultiSelect v-model="selectedCities" inputId="ms_cities" :options="cities" optionLabel="name" filter :maxSelectedLabels="3" class="w-full" variant="filled" />
<label for="ms_cities">Cities</label>
2024-09-20 09:28:05 +00:00
</IftaLabel>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
selectedCities: null,
cities: [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
],
code: {
basic: `
2024-09-23 08:30:11 +00:00
<IftaLabel>
2024-09-28 22:38:06 +00:00
<MultiSelect v-model="selectedCities" inputId="ms_cities" :options="cities" optionLabel="name" filter :maxSelectedLabels="3" class="w-full" variant="filled" />
<label for="ms_cities">Cities</label>
2024-09-20 09:28:05 +00:00
</IftaLabel>
`,
options: `
<template>
<div class="card flex justify-center">
<IftaLabel class="w-full md:w-80">
2024-09-28 22:38:06 +00:00
<MultiSelect v-model="selectedCities" inputId="ms_cities" :options="cities" optionLabel="name" filter :maxSelectedLabels="3" class="w-full" variant="filled" />
<label for="ms_cities">Cities</label>
2024-09-20 09:28:05 +00:00
</IftaLabel>
</div>
</template>
2024-09-23 08:30:11 +00:00
<script>
2024-09-20 09:28:05 +00:00
export default {
data() {
return {
selectedCities: null,
cities: [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
]
};
}
};
<\/script>
`,
composition: `
<template>
<div class="card flex justify-center">
<IftaLabel class="w-full md:w-80">
2024-09-28 22:38:06 +00:00
<MultiSelect v-model="selectedCities" inputId="ms_cities" :options="cities" optionLabel="name" filter :maxSelectedLabels="3" class="w-full"variant="filled" />
<label for="ms_cities">Cities</label>
2024-09-20 09:28:05 +00:00
</IftaLabel>
</div>
</template>
<script setup>
import { ref } from "vue";
const selectedCities = ref(null);
const cities = ref([
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
]);
<\/script>
`
}
};
}
};
</script>