2023-02-28 13:28:23 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>A floating label appears on top of the input field when focused.</p>
|
|
|
|
</DocSectionText>
|
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<div class="p-float-label">
|
2023-10-23 09:25:41 +00:00
|
|
|
<Dropdown v-model="selectedCity" inputId="dd-city" :options="cities" optionLabel="name" class="w-full md:w-14rem" />
|
2023-02-28 13:28:23 +00:00
|
|
|
<label for="dd-city">Select a City</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedCity: null,
|
|
|
|
cities: [
|
|
|
|
{ name: 'New York', code: 'NY' },
|
|
|
|
{ name: 'Rome', code: 'RM' },
|
|
|
|
{ name: 'London', code: 'LDN' },
|
|
|
|
{ name: 'Istanbul', code: 'IST' },
|
|
|
|
{ name: 'Paris', code: 'PRS' }
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<div class="p-float-label">
|
2023-10-23 09:25:41 +00:00
|
|
|
<Dropdown v-model="selectedCity" inputId="dd-city" :options="cities" optionLabel="name" class="w-full md:w-14rem" />
|
2023-02-28 13:28:23 +00:00
|
|
|
<label for="dd-city">Select a City</label>
|
2023-10-15 09:38:39 +00:00
|
|
|
</div>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-02-28 13:28:23 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<div class="p-float-label">
|
2023-10-23 09:25:41 +00:00
|
|
|
<Dropdown v-model="selectedCity" inputId="dd-city" :options="cities" optionLabel="name" class="w-full md:w-14rem" />
|
2023-02-28 13:28:23 +00:00
|
|
|
<label for="dd-city">Select a City</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedCity: null,
|
|
|
|
cities: [
|
|
|
|
{ name: 'New York', code: 'NY' },
|
|
|
|
{ name: 'Rome', code: 'RM' },
|
|
|
|
{ name: 'London', code: 'LDN' },
|
|
|
|
{ name: 'Istanbul', code: 'IST' },
|
|
|
|
{ name: 'Paris', code: 'PRS' }
|
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-02-28 13:28:23 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<div class="p-float-label">
|
2023-10-23 09:25:41 +00:00
|
|
|
<Dropdown v-model="selectedCity" inputId="dd-city" :options="cities" optionLabel="name" class="w-full md:w-14rem" />
|
2023-02-28 13:28:23 +00:00
|
|
|
<label for="dd-city">Select a City</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const selectedCity = ref();
|
|
|
|
const cities = ref([
|
|
|
|
{ name: 'New York', code: 'NY' },
|
|
|
|
{ name: 'Rome', code: 'RM' },
|
|
|
|
{ name: 'London', code: 'LDN' },
|
|
|
|
{ name: 'Istanbul', code: 'IST' },
|
|
|
|
{ name: 'Paris', code: 'PRS' }
|
|
|
|
]);
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-02-28 13:28:23 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|