-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work with vue-awesome #174
Comments
Ok I have found what the problem was. I was doing the import in the layout file, so that I refrain from having to import vue-awesome in each page. However is there a way where I can import it once and the Icon component be usable in every component? This is why I was trying to import it in the layout. |
Hi @CDuane You need to use the nuxt plugins to register the component as global. Example:
module.exports = {
build: {
vendor: ['vue-awesome']
},
plugins: ['~plugins/vue-awesome.js']
}
import Vue from 'vue'
import Icon from 'vue-awesome/components/Icon.vue'
require('vue-awesome/icons')
Vue.component('icon', Icon) Then in your pages and components, you can use the
<template>
<div>
<h1>Welcome!</h1>
<icon name="camera"></icon>
</div>
</template> |
Hey, I'm getting an error
|
@bartdominiak this happens to me as well. I am using |
Downgrade to |
@sobolevn @bartdominiak Same issue here. What can one do to make this work again? |
For me import error was solved by telling webpack to include const nodeExternals = require('webpack-node-externals')
module.exports = {
...
build: {
extend (config, { isServer }) {
if (isServer) {
config.externals = [
nodeExternals({
whitelist: [/^vue-awesome/]
})
]
}
}
} Also you can take a look at #438. |
The issue is with vue awesome. They need to release transpiled version of the code. |
plugins: [{ src: '~plugins/vue-awesome', ssr: false },] |
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. |
Hi, I am trying to get this awesome framework to work with vue-awesome but I can't manage to do it.
I added this to my nuxt.config.js
build: { vendor: ['vue-awesome'] }
I added this to my default.vue
import Icon from "vue-awesome/components/Icon.vue"; import "vue-awesome/icons";
export default { components: { Icon } }
However when I put icon components in my pages, it does not show, but is visible in the chrome dev tools.
Is there a proper way to do this?
I am new to Nuxt.
Thanks for your help.
The text was updated successfully, but these errors were encountered: