vue
vue copied to clipboard
Property '$options' does not exist on type 'VueConstructor<Vue>'.
Version
2.6.10
Reproduction link
https://jsfiddle.net/jafbudpk/3/#&togetherjs=HlrrSLGnsb
Steps to reproduce
import Vue, { PluginFunction } from 'vue';
interface PluginOptions {}
export const Plugin: PluginFunction<PluginOptions> = function Plugin(Vue, PluginOptions): void {
Vue.mixin({
created() {
this.$options.socket = 1;
}
});
};
What is expected?
The $option
should be already type right.
What is actually happening?
Property '$options' does not exist on type 'VueConstructor<Vue>'.ts(2339)
Is there a reason that some public members of the Vue class are not included in the type definition? This is getting really messy for me as I'm having to create a vue-shim.d.ts that augments the VueConstructor type as a work around for this issue.
Umbrella ticket: https://github.com/vuejs/vue/issues/8721
The umbrella issue doesn't appear to be covering the same issue here.