124
rated 0 times
[
130]
[
6]
/ answers: 1 / hits: 5797
/ 4 Years ago, wed, november 18, 2020, 12:00:00
I'm trying to find a way to customize the style of <v-select>
options. I want to provide different backgroundColor
depending on options' value. All of provided :items
will be fixed (always the same), so I need to find a way to either detect options via its specific text value or by declaring unique class/id. What would be the best approach for this? Thank you.
Current Code:
<v-select
:items="[
'This is yellow option', // Yellow background.
'This is blue option', // Blue background.
'This is grey option' // Grey background.
]"
>
</v-select>
HERE is a link to my desired outcome example.
.yellow {
background-color: yellow;
}
.blue {
background-color: blue;
}
.grey {
background-color: grey;
}
<select>
<option>Choose</option>
<option class=yellow>Yellow Backgrond</option>
<option class=blue>Blue Background</option>
<option class=grey>Grey Background</option>
</select>
More From » css