当样式在范围内时不应用 Vuetify 样式

Lav*_*aju 2 vue.js vuetify.js

我正在使用 Vue.js,我应用了基于 v-data-table 类的检查,我给出了样式但没有应用。

<style lang="scss" scoped>
.v-toolbar__title {
  color: indigo;
}
v-data-table-header{
  background:  rgba(0, 0, 0, .05);
}

tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, .05);
}
</style>
Run Code Online (Sandbox Code Playgroud)

Sat*_*hak 10

您需要使用::v-deep来更改scoped样式

尝试

::v-deep .v-data-table-header{
  background:  rgba(0, 0, 0, .05);
}
Run Code Online (Sandbox Code Playgroud)

在此处阅读有关深度选择器的更多信息 - https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors