vue icon indicating copy to clipboard operation
vue copied to clipboard

Property '$options' does not exist on type 'VueConstructor<Vue>'.

Open zsluedem opened this issue 4 years ago • 3 comments

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)

zsluedem avatar Oct 29 '19 06:10 zsluedem

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.

stuft2 avatar Mar 10 '20 17:03 stuft2

Umbrella ticket: https://github.com/vuejs/vue/issues/8721

heyakyra avatar Feb 11 '22 21:02 heyakyra

The umbrella issue doesn't appear to be covering the same issue here.

douglasg14b avatar Mar 01 '22 19:03 douglasg14b