oh-vue-icons icon indicating copy to clipboard operation
oh-vue-icons copied to clipboard

Integration Nuxt + Typescript

Open LuizPelegrini opened this issue 3 years ago • 1 comments

Hi there, I am trying to use the package in a Nuxt project with typescript and I am getting this error when I try to use it

Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' is not assignable to type 'Component<any, any, any, any> | AsyncComponent<any, any, any, any>'.
Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' is not assignable to type 'AsyncComponentFactory<any, any, any, any>'.
Type 'typeof import("~/node_modules/oh-vue-icons/types/index")' provides no match for the signature '(): { component: Promise<ImportedComponent<any, any, any, any>>; loading?: ImportedComponent<DefaultData<never>, DefaultMethods<never>, DefaultComputed, DefaultProps> | undefined; error?: ImportedComponent<...> | undefined; delay?: number | undefined; timeout?: number | undefined; }'.

Usage:

<script lang="ts">
import Vue from 'vue';
import OhVueIcon from 'oh-vue-icons';

export default Vue.extend({
  components: {
    'v-icon': OhVueIcon, // <<< error is thrown here
  },
});
</script>

I've already added the transpilation step in nuxt.config.js

build: {
    transpile: ['oh-vue-icons']
}

Is there anything I'm missing here?

LuizPelegrini avatar Aug 17 '21 06:08 LuizPelegrini

Hi, have you tried importing the package following this?

Renovamen avatar Aug 26 '21 09:08 Renovamen