search

Home  >  Q&A  >  body text

javascript - Why are there two activeLinks in vue? I only click on one link. There should only be one activeLink.

Vue Newcomer-. -It took me a long time to figure it out...help me! ! ~~
I just want to make three icons under the footer. Click on one icon and that icon will change color, while the other icons will not change color.
I saw that after clicking, an active-link will be automatically added, and the style is written in active-link, but how come there are two active links at the same time!

我想大声告诉你我想大声告诉你2754 days ago633

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-19 10:38:08

    '/' root route matches all routes by default. If you want '/' to match only the root path, change it to <router-link to="/" exact>

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-19 10:38:08

    Maybe the active-link of another button is not cleared when clicking one button

    reply
    0
  • Cancelreply