Xua*_*uan 5 textfield vuetify.js
如何更改 Vuetifyv-text-fields输入文本颜色。我尝试了很多方法,但没有一个有效。
我尝试将“Hello”文本更改为红色。它不起作用。
有几种方法可以做到这一点。
一种方便的方法是在 上设置一个类v-text-field,然后使用特异性设置color的input。
!important请注意,在不直接编辑 Vuetify 主题时需要使用该标志。
在模板中,
<v-text-field class="text-green"></v-text-field>
Run Code Online (Sandbox Code Playgroud)
在CSS(例如样式标签)中,
.text-green input {
color: green !important;
}
Run Code Online (Sandbox Code Playgroud)
实时片段:
new Vue({
el: '#app',
data: () => ({
name: 'John'
})
})Run Code Online (Sandbox Code Playgroud)
.text-green input{
color: green !important;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.js"></script>
<div id="app">
<v-app>
<v-text-field class="text-green" v-model="name"></v-text-field>
</v-app>
</div>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31444 次 |
| 最近记录: |