gpt4 book ai didi

css - 为 vuetify 组件添加颜色

转载 作者:太空宇宙 更新时间:2023-11-04 06:35:03 24 4
gpt4 key购买 nike

我正在使用 vuetify 扩展面板 ui 组件 ( https://vuetifyjs.com/en/components/expansion-panels )。我不知道如何为此添加颜色。如您所见,我一直在尝试将 color="#26c6da"添加到多个组件,但没有成功。

<template>
<!-- <v-layout align-start > -->

<!-- <v-layout align-start justify-center row fill-height> -->
<v-container row fill-height justify-center style="max-width: 1200px" class="mx-auto" color="#26c6da">
<!-- <v-layout row fill-height=""> -->
<!-- <v-layout row justify-space-around> -->

<v-flex class="mx-auto" color="#26c6da">
<v-expansion-panel style="max-width: 1200px" class="mx-auto" color="#26c6da" >
<v-expansion-panel-content v-for="(item,i) in items" :key="i">
<div slot="header" class="headline font-weight-bold">{{item.header}}</div>
<v-card >
<v-card-text class="headline font-weight-bold">{{item.text}}</v-card-text>
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
</v-flex>
<!-- </v-layout> -->
</v-container>

这是一个组件代码笔链接:

https://codepen.io/anon/pen/OdJKqm?&editable=true&editors=101

我怎样才能让它工作?

最佳答案

尝试向您想要的任何元素添加标准样式,例如 style="background:#26c6da;color:white" :

new Vue({
el: '#app',

})
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.4.0/dist/vuetify.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vuetify@1.4.0/dist/vuetify.min.css">
<div id="app">
<v-app id="inspire">
<v-expansion-panel>
<v-expansion-panel-content v-for="(item,i) in 5" :key="i" style="background:#26c6da;color:white">
<div slot="header">Item</div>
<v-card>
<v-card-text>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</v-card-text>
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
</v-app>
</div>

关于css - 为 vuetify 组件添加颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54314164/

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