css - 如何更改 Vuetify 组件的错误颜色?
问题描述
我正在尝试从我的组合框中调整错误消息的颜色。我试图覆盖我看到应用的样式,但它并没有坚持下去。我看到在 Vuetify 中应用样式的正常方法是将 [color]--text 添加到组件中,但是我需要做些什么来设置错误样式?
<style>
.error--text {
color:rgb(0, 0, 0) !important;
caret-color: rgb(2, 0, 0) !important;
}
</style>
编辑:这是问题的再现
解决方案
将任意类添加到您的组件(例如app-combobox
):
<v-combobox class="app-combobox"
然后像这样风格:
.app-combobox.error--text,
.app-combobox .error--text {
color: rgb(0, 0, 0) !important;
caret-color: rgb(2, 0, 0) !important;
}
Vuetify 也使用!important
,因此看起来 Vuetify 样式具有更高级别的特异性,因此您需要添加自己的类并使用它以使其具有更多。
似乎.app-combobox.error--text
需要为输入行着色,并.app-combobox. error--text
(使用空格)为子组件(即文本和图标)着色。
推荐阅读
- r - 创建一个表格,其中包含特定格式的日期作为列
- javascript - 检查哨兵报告模式是否已经打开以防止多个弹出窗口
- jquery - ajax 调用的输入意外结束
- f# - 在 FSI 中使用 Azure Cosmos 库从 Azure 表存储中检索数据失败
- aws-cdk - 允许堆栈创建多个 ecr 图像
- python - 使用 pymongo 更新 Mongodb 会随着文件的工作方式显着变慢
- reactjs - 如何在 React Typescript 应用程序中导入 react-admin?
- javascript - 为什么使用滑块时什么都不显示
- android - 如何让 Toolbar 中只有操作项,并尽可能多地使用它的空间?
- android - 扫码时如何修饰摄像头预览?