0

I use axios to send data to v-select, but the content is in html format.

I want to use v-html to convert text but it is unsuccessful.

<v-select
 :items="quizs"
 item-text="questiontext"
 item-value="id"
 v-model="quizid"
></v-select>

My code picture

YI-YI
  • 43
  • 2
  • 6

1 Answers1

0

You could use template inside v-select for your custom display. Then use v-html to decode html tags as below :

<v-select :items='quizs' v-model="quizid">
    <template v-slot:item='{item}'>
         <div v-html='item.questiontext'/>
    </template>
    <template v-slot:selection='{item}'>
         <div v-html='item.questiontext'/>
    </template>
</v-select>
Samidjo
  • 2,315
  • 30
  • 37