vue can penetrate the selector assembly css

If the parent component style set scoped, in addition to the global style and sub-assemblies inside the Modify Style from external style, but if you want to modify the parent component somewhere subcomponents style but do not want to change so little to add a global style how should I do it?

This situation can be used with the penetrating >>> css selector, such as:

<style scoped>

.nav >>> .component{

  color: #f1f1f1;

}

>>> .component{

  color: #fff;

}

</style>

Its depth as well as the same effect acting selector / deep /

<style scoped>

.nav /deep/ .component{

  color: #f1f1f1;

}

/deep/ .component{

  color: #fff;

}

</style>

 

 

Guess you like

Origin www.cnblogs.com/neeter/p/11961527.html