<style lang="scss" scoped>
.wx-layout {
&.wx-left {
color: red;
}
.wx-right {
color: blue;
}
}
</style>
将这段代码翻译成css
<style lang="scss" scoped>
/*串联选择器,作用在同一标签上*/
.wx-layout.wx-left {
color: red;
}
/*后代选择器,作用在子标签上*/
.wx-layout .wx-left {
color: blue;
}
</style>
不明白两种选择器不同点的可以运行到浏览器试试