Nuxt.js: Can't use Vue components in Nuxt

Created on 12 Aug 2017  路  3Comments  路  Source: nuxt/nuxt.js

Hi there, I'm new to just about everything (Vue.js, Nuxt.js, webpack...) so if I'm asking this in the wrong place my apologies.

I would like to use a Vue component such as Vuebar on my app but have as yet been unable to use pretty much any component I've tried to add. I install the package via npm install --save vuebar and it appears in my package.json, then I try to import it in my default layout using
import Vuebar from 'vuebar' export default { components: { Vuebar } }
but when I try to use it in the default layout with <div v-bar></div> it says "failed to resolve directive: bar"

I haven't been able to get any other packages that are used in components to work either so I can't help but think I'm missing some fundamental step here, do I need to add an alias to nuxt.config.js or something like that?

Again, my apologies for the uninformed question, if this is the wrong place please feel free to delete this.

This question is available on Nuxt.js community (#c1196)

Most helpful comment

Alright as I suspected I finally came across the answer right after posting a question, my apologies, found the answers in the plugin documentation here. Somehow I didn't think that applied until I looked at it again just now. Sorry.

All 3 comments

Alright as I suspected I finally came across the answer right after posting a question, my apologies, found the answers in the plugin documentation here. Somehow I didn't think that applied until I looked at it again just now. Sorry.

Thanks for your issue, I made the same mistake.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

surmon-china picture surmon-china  路  3Comments

gary149 picture gary149  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

bimohxh picture bimohxh  路  3Comments

mattdharmon picture mattdharmon  路  3Comments