After adding scoped to the vue parent component, the problem that the style of the child component cannot be modified in the parent component is solved

There are three solutions

One, ::v-deep

.little-box3 ::v-deep img {
  max-height: 175px;
}


.little-box4 ::v-deep .imgBox-1 img{
  width: 300px;
  height: 200px;
}

Two, /deep/

.little-box3 /deep/ img {
  max-height: 175px;
}

三、>>>

.little-box3 >>> img {
  max-height: 175px;
}

 

Guess you like

Origin blog.csdn.net/weixin_43844696/article/details/109486103