我使用axios向v-select发送数据,但内容是html格式的。
我想使用v-html来转换文本,但没有成功。
<v-select
:items="quizs"
item-text="questiontext"
item-value="id"
v-model="quizid"
></v-select>

发布于 2020-02-18 17:18:36
您可以在v-select中使用模板进行自定义显示。然后使用v-html解码html标签,如下所示:
<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>https://stackoverflow.com/questions/60276099
复制相似问题