Vue.js 如何在BootstraVue b表中更改表头颜色

Vue.js 如何在BootstraVue b表中更改表头颜色,vue.js,nuxt.js,bootstrap-vue,Vue.js,Nuxt.js,Bootstrap Vue,我想更改BootstraVue b-table组件中b-table的颜色。 简单的例子是: <template> <div> <b-table :items="items" thead-class="greenColor"> </b-table> </div> </template> <style scoped> .greenColor, .table thead

我想更改BootstraVue b-table组件中b-table的颜色。 简单的例子是:

<template>
    <div>
        <b-table :items="items" thead-class="greenColor">
        </b-table>
    </div>
</template>
<style scoped>
.greenColor, .table thead th, thead, th {
    background-color: #00FF00 !important;
}
</style>
<script>
export default {
    data() {
        return {
            items: [
                {name: "Paweł", surname: "Kowalski"},
                {name: "John", surname: "Nowak"}
            ]
        }
    }
}
</script>

.greenColor、.table thead th、thead、th{
背景色:#00FF00!重要;
}
导出默认值{
数据(){
返回{
项目:[
{姓名:“Paweł”,姓氏:“Kowalski”},
{姓名:“约翰”,姓氏:“诺瓦克”}
]
}
}
}
如您所见,我试图设置AD类(以及正确设置的类,但不起作用)并更改AD元素的样式,但表仍然是白色的。 你知道我可以如何更改此标题的颜色吗

以及package.json中的一些依赖项: “nuxt”:“^2.0.0”, “引导”:“^4.1.3”,
“bootstrap vue”:“^2.0.0”

您面临的问题是因为您使用的是范围限定的样式标记。 如果要以子组件为目标,则需要使用a来正确地以它们为目标

newvue({
el:“#应用程序”,
数据(){
返回{
项目:[
{第一个:'Mikkel',最后一个:'Hansen',年龄:16}
],
字段:[
/* 
(可选)为每个标头定义一个类,
这将覆盖您选择的任何thead类背景
*/
{key:'first',thClass:'bg white text dark'},
{key:'last'},
{key:'age'}
]
}
}
})