Skip to content

从基础路由配置到高级路由守卫,涵盖路由链接高亮、嵌套路由、动态路由、路由元信息、路由守卫等关键知识点。

路由

路由链接高亮显示

内置样式名

在路由导航中,选中的链接中有router-link-activerouter-link-exact-activevue-router模块的内置样式

激活属性类名

vue
<router-link to="/home" active-class="active">Home</router-link>

可以使用liveActiceClass全局配置配置路由链接高亮显示的类名

js
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/home',
            component: Home
        }
    ],
    liveActiceClass: 'active'
})
更新中...

最后更新时间: