可接受的答案不适用于scoped
SASS / SCSS,但可以::v-deep
:
::v-deep .child-class {
background-color: #000;
}
如果您不使用SASS / SCSS,请使用以下>>>
语法:
>>> .child-class {
background-color: #000;
}
使用::v-deep
或时>>>
,<style>
此组件的标签必须为scoped
:
<style scoped>
:
如何在Vue.js中使用/ deep /或>>>?
可接受的答案不适用于scoped
SASS / SCSS,但可以::v-deep
:
::v-deep .child-class {
background-color: #000;
}
如果您不使用SASS / SCSS,请使用以下>>>
语法:
>>> .child-class {
background-color: #000;
}
使用::v-deep
或时>>>
,<style>
此组件的标签必须为scoped
:
<style scoped>
: