Skip to content

Commit

Permalink
fix(Link): propagate active prop to slot as isActive
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jan 24, 2024
1 parent b5b97f3 commit b76e761
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-bind="$attrs"
:class="active ? activeClass : inactiveClass"
>
<slot />
<slot v-bind="{ isActive: active }" />
</component>
<NuxtLink
v-else
Expand All @@ -25,7 +25,7 @@
:class="active !== undefined ? (active ? activeClass : inactiveClass) : resolveLinkClass(route, $route, { isActive, isExactActive })"
@click="(e) => !isExternal && navigate(e)"
>
<slot v-bind="{ isActive: exact ? isExactActive : isActive }" />
<slot v-bind="{ isActive: active !== undefined ? active : (exact ? isExactActive : isActive) }" />
</a>
</NuxtLink>
</template>
Expand Down

1 comment on commit b76e761

@vercel
Copy link

@vercel vercel bot commented on b76e761 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-git-dev-nuxt-js.vercel.app
ui-nuxt-js.vercel.app
ui.nuxt.com

Please sign in to comment.