我尝试使用路由器构造函数中的 linkExactActiveClass 参数来突出显示导航栏中的活动链接。
我的问题是,活动类被添加到 css 类列表的开头,这意味着其他类会覆盖它。
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes,
linkExactActiveClass: 'text-yellow-500',
});
router-link 元素如下所示:text-yellow-500 类确实会添加到现有的 css 类之前。这会导致黄色文本被 text-white 类覆盖。我该如何改变这个?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号