mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(Select): disable placeholder
This commit is contained in:
@@ -175,7 +175,7 @@
|
||||
Card:
|
||||
</div>
|
||||
|
||||
<UCard body-class="flex" @submit.prevent="onSubmit">
|
||||
<UCard body-class="flex">
|
||||
<div class="flex-1 px-4 py-5 sm:p-6 space-y-3">
|
||||
<UFormGroup label="Email" name="email" required>
|
||||
<UInput v-model="form.email" type="email" name="email" required icon="heroicons-outline:mail" />
|
||||
@@ -190,6 +190,7 @@
|
||||
v-model="form.personId"
|
||||
name="person"
|
||||
:options="people"
|
||||
placeholder="Select a person"
|
||||
text-attribute="name"
|
||||
value-attribute="id"
|
||||
icon="heroicons-outline:user"
|
||||
@@ -253,7 +254,7 @@ const form = reactive({
|
||||
notification: 'email',
|
||||
notifications: [],
|
||||
terms: false,
|
||||
personId: people[0].id,
|
||||
personId: null,
|
||||
person: ref(people[0])
|
||||
})
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<select
|
||||
:id="name"
|
||||
:name="name"
|
||||
:value="modelValue"
|
||||
:required="required"
|
||||
:disabled="disabled"
|
||||
:class="selectClass"
|
||||
@@ -20,6 +21,7 @@
|
||||
:key="`${childOption[valueAttribute]}-${index}-${index2}`"
|
||||
:value="childOption[valueAttribute]"
|
||||
:selected="childOption[valueAttribute] === normalizedValue"
|
||||
:disabled="option.disabled"
|
||||
v-text="childOption[textAttribute]"
|
||||
/>
|
||||
</optgroup>
|
||||
@@ -28,6 +30,7 @@
|
||||
:key="`${option[valueAttribute]}-${index}`"
|
||||
:value="option[valueAttribute]"
|
||||
:selected="option[valueAttribute] === normalizedValue"
|
||||
:disabled="option.disabled"
|
||||
v-text="option[textAttribute]"
|
||||
/>
|
||||
</template>
|
||||
@@ -154,7 +157,8 @@ export default {
|
||||
return [
|
||||
{
|
||||
[props.valueAttribute]: null,
|
||||
[props.textAttribute]: props.placeholder
|
||||
[props.textAttribute]: props.placeholder,
|
||||
disabled: true
|
||||
},
|
||||
...normalizedOptions.value
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user