Skip to content

In Vue2 and vue-class-component 7.2.3, how can i add a properties to the Object 'this'  #641

Open
@toplyb

Description

@toplyb

In the shims-vue.d.ts file:

import Vue from 'vue';

declare module 'vue/types/vue' {
  interface Vue {
    $messageBox: any;
  }
}

declare module '*.vue' {
  import Vue from 'vue';
  export default Vue;
}
declare module '*.js';

I want to add the '$messageBox' in 'this', but i got the error in Vue component file:
image
My code is :

@Component({
  components: {
    [Dialog.Component.name]: Dialog.Component,
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions