coreui/coreui-vue

CLink/CNavLink incompatable with RouterLink

hananf11 opened this issue · 1 comments

  • Windows 11
  • Firefox 105.0.3
  • Make the click event on CLink a standard click event so it can work with the RouterLink navigate

I was trying to wrap CNavLink in a RouterLink component however it seems this can't be done clicking the link does not navigate the page.

Here is the code I was using

<RouterLink :to="$props.to" v-bind="$props" custom v-slot="{ isActive, href, navigate}">
    <CNavLink :href="href" @click="navigate" :active="isActive">
        <slot></slot>
    </CNavLink>
</RouterLink>

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions