[Vuejs]-MetaInfo fail Gridsome – typescript

0👍

I seem I found the right configuration (vue-shims.d.ts):

OLD – BAD config

declare module "*.vue" {
  import Vue from "vue";
  export default Vue;
}
declare module "vue/types/options" {
  interface ComponentOptions<V extends Vue> {
    metaInfo?: any;
  }
}

The way I realize here was something odd was because inside the dependency:
node_modules/vue-meta/types/vue.d.ts was a declaration doing the same thing. Additionally, the index.d.ts in the same file export default and literal-object.

Corrected Code:

declare module "*.vue" {
  import * as Vue from "vue";
  export default Vue;
}

A you see now the declaration import * as Vue .

Think the answer is right, but if there’s a feedback glad to read it.

👤jasmo2

-1👍

👤nabeen

Leave a comment