mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
Fix dropdown component for group select [SCI-6583] (#3905)
This commit is contained in:
parent
99e8f7e3cb
commit
4e118d095d
1 changed files with 17 additions and 12 deletions
|
@ -7,8 +7,22 @@
|
|||
:data-select-multiple-name="dataSelectMultipleName"
|
||||
:data-placeholder="placeholder"
|
||||
>
|
||||
<optgroup v-if="groupSelector" v-for="group in this.options" :label="group.label">
|
||||
<option v-for="option in group.options"
|
||||
<template v-if="groupSelector">
|
||||
<optgroup v-for="group in this.options" :label="group.label" :key="group.label">
|
||||
<option v-for="option in group.options"
|
||||
:key="option.label"
|
||||
:value="option.value"
|
||||
:selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == option.value))"
|
||||
:data-selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == option.value))"
|
||||
:data-params="JSON.stringify(option.params)"
|
||||
:data-group="group.label">
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</optgroup>
|
||||
</template>
|
||||
<template v-else>
|
||||
<option
|
||||
v-for="option in this.options"
|
||||
:key="option.label"
|
||||
:value="option.value"
|
||||
:selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == option.value))"
|
||||
|
@ -16,16 +30,7 @@
|
|||
:data-params="JSON.stringify(option.params)">
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</optgroup>
|
||||
<option v-if="!groupSelector"
|
||||
v-for="option in this.options"
|
||||
:key="option.label"
|
||||
:value="option.value"
|
||||
:selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == option.value))"
|
||||
:data-selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == option.value))"
|
||||
:data-params="JSON.stringify(option.params)">
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue