如何在 v-radio 标签中设置 HTML [英] How to set HTML in v-radio label

查看:32
本文介绍了如何在 v-radio 标签中设置 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了 文档v-radio 组件,但没有找到设置 label 与 HTML 的方法.有没有人知道有没有办法做到这一点?

I've checked the documentation for v-radio components but didn't found a way to set the label with HTML in it. Does anyone know if there is a way to do so?

<v-radio  label="Some <b>text</b>" value="some-value"></v-radio>

推荐答案

有一个 label 槽用于此.
因此,如果您需要 html 标签,请不要使用 prop.

There is a label slot for this.
So do NOT use prop if you need html label.

codepen

<v-radio value="radio-1">
  <template slot="label">
    Vuetify is actually&nbsp;<b>Awesome</b> 
  </template>
</v-radio>

这篇关于如何在 v-radio 标签中设置 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆