aboutsummaryrefslogtreecommitdiff
path: root/src/components/optional_router_link/optional_router_link.vue
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-08-31 00:48:38 +0300
committerHenry Jameson <me@hjkos.com>2022-08-31 00:48:38 +0300
commit8ecb67230c87754d43c4255c56c05566c8c53feb (patch)
treeb5141c8b44e306e651f53e87c9239620d2ea600d /src/components/optional_router_link/optional_router_link.vue
parent8b25febe36a97d113c846928dab22ab36158ee07 (diff)
make custom router-link for nav-entry to un-nest the interactive elements
Diffstat (limited to 'src/components/optional_router_link/optional_router_link.vue')
-rw-r--r--src/components/optional_router_link/optional_router_link.vue22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/components/optional_router_link/optional_router_link.vue b/src/components/optional_router_link/optional_router_link.vue
new file mode 100644
index 00000000..4eef0d6a
--- /dev/null
+++ b/src/components/optional_router_link/optional_router_link.vue
@@ -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>