Skip to content

Commit 2077d7c

Browse files
committed
feat: labels can contain HTML
1 parent 73f1b66 commit 2077d7c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Multiselect.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,15 @@
7272
<template v-if="mode == 'single' && hasSelected && !search && iv">
7373
<slot name="singlelabel" :value="iv">
7474
<div :class="classList.singleLabel">
75-
<span :class="classList.singleLabelText">{{ iv[label] }}</span>
75+
<span :class="classList.singleLabelText" v-html="iv[label]"></span>
7676
</div>
7777
</slot>
7878
</template>
7979

8080
<!-- Multiple label -->
8181
<template v-if="mode == 'multiple' && hasSelected && !search">
8282
<slot name="multiplelabel" :values="iv">
83-
<div :class="classList.multipleLabel">
84-
{{ multipleLabelText }}
85-
</div>
83+
<div :class="classList.multipleLabel" v-html="multipleLabelText"></div>
8684
</slot>
8785
</template>
8886

@@ -131,7 +129,7 @@
131129
@click="handleGroupClick(group)"
132130
>
133131
<slot name="grouplabel" :group="group">
134-
<span>{{ group[groupLabel] }}</span>
132+
<span v-html="group[groupLabel]"></span>
135133
</slot>
136134
</div>
137135

@@ -145,7 +143,7 @@
145143
@click="handleOptionClick(option)"
146144
>
147145
<slot name="option" :option="option" :search="search">
148-
<span>{{ option[label] }}</span>
146+
<span v-html="option[label]"></span>
149147
</slot>
150148
</li>
151149
</ul>
@@ -161,7 +159,7 @@
161159
@click="handleOptionClick(option)"
162160
>
163161
<slot name="option" :option="option" :search="search">
164-
<span>{{ option[label] }}</span>
162+
<span v-html="option[label]"></span>
165163
</slot>
166164
</li>
167165
</template>

0 commit comments

Comments
 (0)