Skip to content
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

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

Open
toplyb opened this issue Dec 19, 2023 · 0 comments

Comments

@toplyb
Copy link

toplyb commented Dec 19, 2023

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,
  },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant