如何将 SVG 图像添加到 vuetify 文本字段 [英] How to add SVG image to vuetify text field
本文介绍了如何将 SVG 图像添加到 vuetify 文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 vuetify 并想在文本字段的开头添加一个 SVG 图标.我知道您可以在 v-icon 中添加或附加图标,但我想以类似的方式使用我自己的 SVG 图像.
I am using vuetify and would like to add an SVG icon to the start of the text field. I know you can prepend or append icons from v-icon, but I would like to use my own SVG image in a similar way.
推荐答案
只需使用prepend"槽:
Just use the "prepend" slot:
<v-text-field label="My text field" type="text">
<template v-slot:prepend>
<img width="24" height="24" src="[PathToAssets]/whatever.svg" >
</template>
</v-text-field>
这篇关于如何将 SVG 图像添加到 vuetify 文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文