Skip to content

Commit

Permalink
fix(Link): reactivity issue with active prop
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Nov 22, 2023
1 parent dd55b4f commit 15a40f5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/runtime/components/elements/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:role="disabled ? 'link' : undefined"
:rel="rel"
:target="target"
:class="resolveLinkClass(route, $route, { isActive, isExactActive })"
:class="active ? activeClass : resolveLinkClass(route, $route, { isActive, isExactActive })"
@click="(e) => !isExternal && navigate(e)"
>
<slot v-bind="{ isActive: exact ? isExactActive : isActive }" />
Expand Down Expand Up @@ -69,10 +69,6 @@ export default defineComponent({
},
setup (props) {
function resolveLinkClass (route, $route, { isActive, isExactActive }: { isActive: boolean, isExactActive: boolean }) {
if (props.active) {
return props.activeClass
}
if (props.exactQuery && !isEqual(route.query, $route.query)) {
return props.inactiveClass
}
Expand Down

1 comment on commit 15a40f5

@vercel
Copy link

@vercel vercel bot commented on 15a40f5 Nov 22, 2023

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.com
ui-nuxt-js.vercel.app

Please sign in to comment.