mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 14:44:26 +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-select-multiple-name="dataSelectMultipleName"
|
||||||
:data-placeholder="placeholder"
|
:data-placeholder="placeholder"
|
||||||
>
|
>
|
||||||
<optgroup v-if="groupSelector" v-for="group in this.options" :label="group.label">
|
<template v-if="groupSelector">
|
||||||
<option v-for="option in group.options"
|
<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"
|
:key="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
:selected="option.value == selectedValue || (Array.isArray(selectedValue) && selectedValue.some(e => e == 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)">
|
:data-params="JSON.stringify(option.params)">
|
||||||
{{ option.label }}
|
{{ option.label }}
|
||||||
</option>
|
</option>
|
||||||
</optgroup>
|
</template>
|
||||||
<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>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in a new issue