gluons / vue-github-buttons

:octocat: GitHub buttons component for Vue.
https://git.io/vue-github-buttons
Apache License 2.0
37 stars 10 forks source link

Doesn't work with Vue/Nuxt #9

Closed Rajan closed 6 years ago

Rajan commented 6 years ago
vue.runtime.esm.js:472 [Vue warn]: Unknown custom element: <gh-btns-star> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Pages/index.vue> at pages/index.vue
       <Nuxt>
         <Default> at layouts/default.vue
           <Root>

Create a Nuxt.js Vue application and try to display stars button and it'll show this in the console.

gluons commented 6 years ago

OK. I'll look into it when I'm free.

gluons commented 6 years ago

I've tried it myself. I actually work.

Have you added this plugin into your Nuxt config?

plugins/vue-github-buttons.js:

import Vue from 'vue';
import VueGitHubButtons from 'vue-github-buttons';

Vue.use(VueGitHubButtons);

import 'vue-github-buttons/dist/vue-github-buttons.css';

nuxt.config.js:

module.exports = {
    plugins: [
        '~/plugins/vue-github-buttons'
    ]
};
gluons commented 6 years ago

v2.1.1 released.

Now, you don't need to write plugin by yourself anymore.
New version provides modules for easier using with Nuxt.