arielsalminen / vue-design-system

An open source tool for building UI Design Systems with Vue.js
https://vueds.com
MIT License
2.17k stars 224 forks source link

[Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? #105

Closed michaelpumo closed 5 years ago

michaelpumo commented 6 years ago

I want to be able to use <router-link> within my components, but I get multiple errors when I do this:

[Vue warn]: Unknown custom element: - did you register the component correctly?

Vue router as far as I'm aware sets this globally. main.js imports the router file and all looks fine.

Routing works on pages that use the router, but how can I get it to work within the design system and components themselves without getting the error?

I can't explicitly do something like:

import { RouterLink } from 'vue-router'

...as vue-router doesn't appear to expose that method.

arielsalminen commented 5 years ago

@michaelpumo Where are you getting this error? On the design system docs or the app?

michaelpumo commented 5 years ago

Yes, it’s within the design system itself when viewing components from the list.

arielsalminen commented 5 years ago

@michaelpumo This error is related to Vue Styleguidist that is used to generate the docs. Please see f.ex.: https://github.com/vue-styleguidist/vue-styleguidist/issues/131