Hi,
Is HTML on labels supported?
example:
[
{
"value": "foo",
"label": "<b>foo</b>"
}
]
Should output the bold "foo"
No. It will be not bold. It will be escaped.
From the source code:
<a @mousedown.prevent="select(option)">
{{ getOptionLabel(option) }}
</a>
This means it will escape whatever you put in the label.
@nya1 this is coming in v2.3.0.
When will v2.3.0 will be released ? Without this feature i can't use your awesome component :(
When will v2.3.0 will be released ? Without this feature i can't use your awesome component :(
Looks like this was dropped?
@sagalbot ?? Any news ?? You released v 2.3.0 and more but still no html label :(
Any updates on this?
is there a way to pass HTML labels?
:get-option-label="getOrderLabel"
getOrderLabel(option) {
return '<span class="red">'+option.status.name+'</span>'
}
this would return escaped html..
For anyone interested, the way to do this would be to use the selected-option slot.
Put this within your <v-select></v-select> component.
<template slot="selected-option" slot-scope="option">
<span v-html="option.label"></span>
</template>
This will give you your label in html.
Examples here: https://vue-select.org/guide/slots.html
Most helpful comment
@nya1 this is coming in
v2.3.0.