therufa / mdi-vue

Material design icons for vue.js
https://www.npmjs.com/package/mdi-vue
MIT License
88 stars 13 forks source link

Nuxt.js importing needs .vue extention #26

Closed josephfh closed 4 years ago

josephfh commented 4 years ago

Using the latest version of Nuxt.js

import HookIcon from 'mdi-vue/Hook' doesn't work, whereas this does: import HookIcon from 'mdi-vue/Hook'.vue

Could be worth making a note if this is working in normal Vue.js. Thanks!

therufa commented 4 years ago

@josephfh thanks for your effort i'll take a look at this when possible. If you have any spare time though, I'm happy to accept guesses or fixes of any sort :D

timhoeppner commented 4 years ago

I'm using Nuxt and this isn't an issue for me, I can import without the extension. I've been using something like:

Vue.component('settings-icon', () => import('mdi-vue/Settings'))

therufa commented 4 years ago

I don't see this as an issue anymore. We have each file now in the form of a single-file component and compiled to js. Basically you can just import it as stated in the docs, or with the *.vue extension