How does vue-router router-link change the value of child elements

router-link tag has a img tag, how to change the picture of img according to the activation state of router-link

the code is as follows: `

< router-link to= "/ chat" > < / router-link >

because .router-link-active itself has a graded background, it is impossible to set the background image directly.


uses < router-link to= "/ chat" > < / router-link > with css's first-child and last-child to solve the problem.

Menu