<h3 dir="auto">Version</h3>
<p dir="auto">2.5.16</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codesandbox.io/s/github/weihongyu12/vue-typescript-demo" rel="nofollow">https://codesandbox.io/s/github/weihongyu12/vue-typescript-demo</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Uses @vue/cli to build the project. The configuration uses TypeScript. However, in the process of using, in the <code class="notranslate">methods</code>, there is no access to the <code class="notranslate">computed</code>. The construction does not exist on type 'Vue'.</p>
<div class="highlight highlight-text-html-vue notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;template&gt;
  &lt;ul
    v-if=&quot;show&quot;
    class=&quot;picker&quot;&gt;
    &lt;li
      v-for=&quot;(item, index) of pickerList&quot;
      :key=&quot;index&quot;&gt;{{ item }}&lt;/li&gt;
  &lt;/ul&gt;
&lt;/template&gt;

&lt;script lang=&quot;ts&quot;&gt;
import Vue from 'vue';

export default Vue.extend({
  name : 'Picker',
  props: {
    columns: {
      type: Array,
      default: [],
    },
    show: {
      type: Boolean ,
      default: false,
    },
  },
  computed: {
    pickerList(): Array&lt;string&gt; {
      const arr = [];
      const columns: any = this.columns;
      for (const item of columns) {
        arr.push(item.title);
      }
      return arr;
    },
    pickerMap() : Map&lt;string, number&gt; {
      const map = new Map();
      const columns: any = this.columns;
      for (const item of columns) {
        map.set(item.title, item.id);
      }
      return map;
    },
  },
  methods: {
    onConfirm(value: string): void {
      const resumeId = this.pickerMap.get(value);  // Property 'pickerMap' does not exist on type 'Vue'.
      this.$emit('confirm', resumeId);
    },
  },
});
&lt;/script&gt;"><pre class="notranslate">&lt;<span class="pl-ent">template</span>&gt;
  &lt;<span class="pl-ent">ul</span>
    <span class="pl-e">v-if</span>=<span class="pl-s1"><span class="pl-pds">"</span>show<span class="pl-pds">"</span></span>
    <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>picker<span class="pl-pds">"</span></span>&gt;
    &lt;<span class="pl-ent">li</span>
      <span class="pl-e">v-for</span>=<span class="pl-s1"><span class="pl-pds">"</span>(item, index) <span class="pl-k">of</span> pickerList<span class="pl-pds">"</span></span>
      :<span class="pl-e">key</span>=<span class="pl-s1"><span class="pl-pds">"</span>index<span class="pl-pds">"</span></span>&gt;{{ item }}&lt;/<span class="pl-ent">li</span>&gt;
  &lt;/<span class="pl-ent">ul</span>&gt;
&lt;/<span class="pl-ent">template</span>&gt;

<span class="pl-s1">&lt;<span class="pl-ent">script</span> <span class="pl-e">lang</span>=<span class="pl-s"><span class="pl-pds">"</span>ts<span class="pl-pds">"</span></span>&gt;</span>
<span class="pl-s1"><span class="pl-k">import</span> <span class="pl-smi">Vue</span> <span class="pl-k">from</span> <span class="pl-s"><span class="pl-pds">'</span>vue<span class="pl-pds">'</span></span>;</span>
<span class="pl-s1"></span>
<span class="pl-s1"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-smi">Vue</span>.<span class="pl-en">extend</span>({</span>
<span class="pl-s1">  name : <span class="pl-s"><span class="pl-pds">'</span>Picker<span class="pl-pds">'</span></span>,</span>
<span class="pl-s1">  props: {</span>
<span class="pl-s1">    columns: {</span>
<span class="pl-s1">      type: <span class="pl-c1">Array</span>,</span>
<span class="pl-s1">      default: [],</span>
<span class="pl-s1">    },</span>
<span class="pl-s1">    show: {</span>
<span class="pl-s1">      type: <span class="pl-c1">Boolean</span> ,</span>
<span class="pl-s1">      default: <span class="pl-c1">false</span>,</span>
<span class="pl-s1">    },</span>
<span class="pl-s1">  },</span>
<span class="pl-s1">  computed: {</span>
<span class="pl-s1">    pickerList()<span class="pl-k">:</span> <span class="pl-en">Array</span>&lt;<span class="pl-c1">string</span>&gt; {</span>
<span class="pl-s1">      <span class="pl-k"><span class="pl-k">const</span></span> arr <span class="pl-k">=</span> [];</span>
<span class="pl-s1">      <span class="pl-k"><span class="pl-k">const</span></span> columns<span class="pl-k">:</span> <span class="pl-c1">any</span> <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">columns</span>;</span>
<span class="pl-s1">      <span class="pl-k">for</span> (<span class="pl-k"><span class="pl-k">const</span></span> item <span class="pl-k">of</span> <span class="pl-smi">columns</span>) {</span>
<span class="pl-s1">        <span class="pl-smi">arr</span>.<span class="pl-c1">push</span>(<span class="pl-smi">item</span>.<span class="pl-c1">title</span>);</span>
<span class="pl-s1">      }</span>
<span class="pl-s1">      <span class="pl-k">return</span> <span class="pl-smi">arr</span>;</span>
<span class="pl-s1">    },</span>
<span class="pl-s1">    pickerMap() <span class="pl-k">:</span> <span class="pl-en">Map</span>&lt;<span class="pl-c1">string</span>, <span class="pl-c1">number</span>&gt; {</span>
<span class="pl-s1">      <span class="pl-k"><span class="pl-k">const</span></span> map <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">Map</span>();</span>
<span class="pl-s1">      <span class="pl-k"><span class="pl-k">const</span></span> columns<span class="pl-k">:</span> <span class="pl-c1">any</span> <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">columns</span>;</span>
<span class="pl-s1">      <span class="pl-k">for</span> (<span class="pl-k"><span class="pl-k">const</span></span> item <span class="pl-k">of</span> <span class="pl-smi">columns</span>) {</span>
<span class="pl-s1">        <span class="pl-smi">map</span>.<span class="pl-c1">set</span>(<span class="pl-smi">item</span>.<span class="pl-c1">title</span>, <span class="pl-smi">item</span>.<span class="pl-c1">id</span>);</span>
<span class="pl-s1">      }</span>
<span class="pl-s1">      <span class="pl-k">return</span> <span class="pl-smi">map</span>;</span>
<span class="pl-s1">    },</span>
<span class="pl-s1">  },</span>
<span class="pl-s1">  methods: {</span>
<span class="pl-s1">    onConfirm(<span class="pl-v">value</span><span class="pl-k">:</span> <span class="pl-c1">string</span>)<span class="pl-k">:</span> <span class="pl-c1">void</span> {</span>
<span class="pl-s1">      <span class="pl-k"><span class="pl-k">const</span></span> resumeId <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">pickerMap</span>.<span class="pl-c1">get</span>(<span class="pl-smi">value</span>);  <span class="pl-c"><span class="pl-c">//</span> Property 'pickerMap' does not exist on type 'Vue'.</span></span>
<span class="pl-s1">      <span class="pl-c1">this</span>.<span class="pl-en">$emit</span>(<span class="pl-s"><span class="pl-pds">'</span>confirm<span class="pl-pds">'</span></span>, <span class="pl-smi">resumeId</span>);</span>
<span class="pl-s1">    },</span>
<span class="pl-s1">  },</span>
<span class="pl-s1">});</span>
<span class="pl-s1">&lt;/<span class="pl-ent">script</span>&gt;</span></pre></div>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">I don't know if it's because of my writing, or because of the configuration that caused me this error. I wrote the code based on the official document. I believe it can be build successfully.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">When I run <code class="notranslate">npm run build</code>, an error Property 'pickerMap' does not exist on type 'Vue'. The complete prompt is as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in E:/project/demo/src/components/picker.vue
44:29 Property 'pickerMap' does not exist on type 'Vue'.
     42 | methods: {
     43 | onConfirm(value: string): void {
   &gt; 44 | const resumeId = this.pickerMap.get(value);
        | ^
     45 | this.$emit('confirm', resumeId);
     46 | },
     47 | },"><pre class="notranslate"><code class="notranslate">ERROR in E:/project/demo/src/components/picker.vue
44:29 Property 'pickerMap' does not exist on type 'Vue'.
     42 | methods: {
     43 | onConfirm(value: string): void {
   &gt; 44 | const resumeId = this.pickerMap.get(value);
        | ^
     45 | this.$emit('confirm', resumeId);
     46 | },
     47 | },
</code></pre></div>
<hr>
<p dir="auto">I do not know of any reason for this error. It is imperative that I have a friend to help me solve this error, but I hope that the official can speed up the improvement of TypeScript's documentation, because I believe TypeScript will become popular. Thank you.</p>
<h3 dir="auto">Version</h3>
<p dir="auto">2.5.2</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://github.com/wonderful-panda/vue-sandbox">https://github.com/wonderful-panda/vue-sandbox</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Compile this code by tsc</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Vue, { VNode } from &quot;vue&quot;;

const NgComponent = Vue.extend({
    name: &quot;NgComponent&quot;,
    props: {
        foo: { type: String },
        bar: {}    // any types are accepted
    },
    render(h): VNode {
        return h(&quot;div&quot;, this.foo);
    }
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Vue</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-smi">VNode</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"vue"</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-smi">NgComponent</span> <span class="pl-c1">=</span> <span class="pl-smi">Vue</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">name</span>: <span class="pl-s">"NgComponent"</span><span class="pl-kos">,</span>
    <span class="pl-c1">props</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">foo</span>: <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-smi">String</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-c1">bar</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span>    <span class="pl-c">// any types are accepted</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">)</span>: <span class="pl-smi">VNode</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-en">h</span><span class="pl-kos">(</span><span class="pl-s">"div"</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">or clone from repro link and <code class="notranslate">npm install &amp;&amp; npm run build</code></p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Successfully compiled.</p>
<p dir="auto">And <code class="notranslate">this.foo</code> is treated as string, <code class="notranslate">this.bar</code> is treated as any.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Failed to compile.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/index.ts(10,30): error TS2339: Property 'foo' does not exist on type 'CombinedVueInstance&lt;Vue, {}, {}, {}, Readonly&lt;{}&gt;&gt;'."><pre class="notranslate"><code class="notranslate">src/index.ts(10,30): error TS2339: Property 'foo' does not exist on type 'CombinedVueInstance&lt;Vue, {}, {}, {}, Readonly&lt;{}&gt;&gt;'.
</code></pre></div>
<hr>
<p dir="auto">Workaround:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Vue, { VNode } from &quot;vue&quot;;

Vue.extend({
    name: &quot;Workaround&quot;,
    props: {
        foo: { type: String },
        bar: {} as (() =&gt; any)   // any types are accepted
    },
    render(h): VNode {
        return h(&quot;div&quot;, this.foo);
    }
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Vue</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-smi">VNode</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"vue"</span><span class="pl-kos">;</span>

<span class="pl-smi">Vue</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">name</span>: <span class="pl-s">"Workaround"</span><span class="pl-kos">,</span>
    <span class="pl-c1">props</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">foo</span>: <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-smi">String</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-c1">bar</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-k">as</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">any</span><span class="pl-kos">)</span>   <span class="pl-c">// any types are accepted</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">)</span>: <span class="pl-smi">VNode</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-en">h</span><span class="pl-kos">(</span><span class="pl-s">"div"</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>