gpt4 book ai didi

vue.js - 如何更改/覆盖 vuetify 中开关标签的默认颜色?

转载 作者:行者123 更新时间:2023-12-03 06:37:38 24 4
gpt4 key购买 nike

正如您从 vuetify 的官方文档中看到的,开关的标签有自己的预定义颜色。我如何覆盖它们以获得黑色文本?我将 switch 作为 Prop 从一个名为 form structure 的全局组件传递到另一个我命名为“Primary”的组件中
https://vuetifyjs.com/en/components/selection-controls

<v-switch v-if="externalSwitch" model="switch2":label="externalSwitchLabel"> 
</v-switch>

<v-layout v-for="info in information" :key="info.title">
<v-flex>
<form-structure :externalSwitchLabel="`${info.title}`"
:externalSwitch="true" :hasSubTitle="true" :subTitle="`${info.status}`"
:script="`${info.script}`">
</form-structure>
</v-flex>
</v-layout>
我的数组如下所示:
information : [
{title: "Something1", status:"active", script: "Hello"},
{title: "Something2", status:"in Progress", script: "Ciao" }
]
我的 CSS 看起来像这样:
<style scoped>
.v-label.theme--light {
color: black
}
</style>

最佳答案

我尝试了插槽方法,它对我有用:

<v-switch>
<template v-slot:label>
<span class="input__label">Label text</span>
</template>
</v-switch>
CSS看起来像这样:
.input__label {
color: black;
}

关于vue.js - 如何更改/覆盖 vuetify 中开关标签的默认颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54373084/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com