在 Vue Router 中,router-link-active
和 router-link-exact-active
是两种用于指示当前激活路由的 class 名称。
router-link-active
会在当前路由匹配到的路由及其子路由上添加,而 router-link-exact-active
仅在当前路由完全匹配时添加。
举例来说,假设有如下路由配置:
const routes = [
{
path: '/', component: Home },
{
path