Maybe I'm wrong, but couldn't you skip all the 'nuxt' prop passing if you just: a) check for this.$nuxt and b) check for a starting slash on the 'to' prop?
i.e.
<nuxt-link v-if="isNuxtLink" :to="to"><slot></slot></nuxt-link> <a v-else :href="to"><slot></slot></a>
... props: ['to'], computed: { isNuxtLink() { return this.$nuxt && this.to.substring(0,1) === '/' } }
Oh yeah! That'll do it. I appreciate the feedback and I'll probably go ahead and use this. Thanks!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Maybe I'm wrong, but couldn't you skip all the 'nuxt' prop passing if you just:
a) check for this.$nuxt and
b) check for a starting slash on the 'to' prop?
i.e.
Oh yeah! That'll do it. I appreciate the feedback and I'll probably go ahead and use this. Thanks!