Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在数字输入中添加SVG_Html_Css_Forms_Vue.js - Fatal编程技术网

Html 在数字输入中添加SVG

Html 在数字输入中添加SVG,html,css,forms,vue.js,Html,Css,Forms,Vue.js,我有一个数字输入表单字段 <input type="number" name="" v-model.lazy="userResponse" placeholder="Enter value here" class="bg-white border-gray-300 border-2 text-gray-600 shadow-md px-6 py-4 rounded-lg my-2" :class="{ 'border-teal-500 border-2' : isCorrect }" :d

我有一个数字输入表单字段

<input type="number" name="" v-model.lazy="userResponse" placeholder="Enter value here" class="bg-white border-gray-300 border-2 text-gray-600 shadow-md px-6 py-4 rounded-lg my-2" :class="{ 'border-teal-500 border-2' : isCorrect }" :disabled="showFeedbackView">

它给了我这个:

每当isCorrect值为true时,我想在值旁边添加一个svg复选标记图标


有办法吗?

添加类
是正确的
,遵循以下规则:

.is-correct{
    background-image: url(/path/to/success.svg);
}
然后像这样使用它:

:class="{ 'border-teal-500 border-2 is-correct' : isCorrect }"

我从

中得到了答案,添加类
是正确的
,遵循以下规则:

.is-correct{
    background-image: url(/path/to/success.svg);
}
然后像这样使用它:

:class="{ 'border-teal-500 border-2 is-correct' : isCorrect }"

我从

中得到了答案是的,我应该这么做。我只是将它嵌入到一个div中,并添加了带有绝对位置的SVG。是的,将输入和SVG放入一个带有相对位置的容器中,然后使用正确的属性播放SVG。是的,我应该这样做。我只是将它嵌入到一个div中,并添加了带有绝对位置的SVG。是的,将输入和SVG放在一个带有相对位置和带有绝对位置的SVG的容器中,然后使用right属性播放