selector - add default value

This commit is contained in:
isUnknown 2024-09-10 16:34:02 +02:00
parent 9d89d624f1
commit 591625e15a

View file

@ -8,17 +8,24 @@
" "
> >
<label for="inspirations">Choisir une inspiration</label> <label for="inspirations">Choisir une inspiration</label>
<Select id="inspirations" v-model="selectedInspiration" :options="inspirations" optionLabel="name" optionValue="value" class="" /> <Select
</div> id="inspirations"
v-model="selectedInspiration"
:options="inspirations"
optionLabel="name"
optionValue="value"
class=""
/>
</div>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
const selectedInspiration = ref(); const selectedInspiration = ref("shape-of-nature");
const inspirations = ref([ const inspirations = ref([
{ name: 'Shape of Nature', value: 'shape-of-nature', selected: true }, { name: "Shape of Nature", value: "shape-of-nature" },
{ name: 'Inspiration Title', value: 'inspiration-title' } { name: "Inspiration Title", value: "inspiration-title" },
]); ]);
</script> </script>