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
StealthCoder1109 committed Nov 22, 2023
1 parent c68e8ed commit 8c4658e
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

0 comments on commit 8c4658e

Please sign in to comment.