make custom router-link for nav-entry to un-nest the interactive elements
This commit is contained in:
parent
8b25febe36
commit
8ecb67230c
4 changed files with 100 additions and 68 deletions
22
src/components/optional_router_link/optional_router_link.vue
Normal file
22
src/components/optional_router_link/optional_router_link.vue
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<router-link
|
||||
v-if="to"
|
||||
:to="to"
|
||||
custom
|
||||
v-slot="props"
|
||||
>
|
||||
<slot
|
||||
v-bind="props"
|
||||
/>
|
||||
</router-link>
|
||||
<slot
|
||||
v-else
|
||||
v-bind="{}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['to']
|
||||
}
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue