Home > Blockchain >  How to target tag element with :v-deep() selector?
How to target tag element with :v-deep() selector?

Time:04-12

When I use:

::v-deep img { ... }

it works but I get a deprecation warning:

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.

How do I do the same thing but with :v-deep(img)? No matter how I try it, I get an unknown pseudo selector error.

CodePudding user response:

You are putting v- before deep because of which you're getting unknown selector error try out this piece of code

:deep(img){
/* Your styles  */
}

CodePudding user response:

:deep(.child-class) {
    background-color: #000;
}

You can read more info here

  • Related