vetur icon indicating copy to clipboard operation
vetur copied to clipboard

Intellisense not work if the component doesn't have any of data, computed, methods (mirror of #838)

Open padcom opened this issue 3 years ago • 1 comments

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ
  • [x] I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Linux
  • Vetur version: v0.35.0
  • VS Code version: 1.66.2
  • Vue 2.6.14

Problem

Currently, when working with Vetur from VS Code when I want to use a function to calculate part of the returned data Vetur doesn't know about the defined methods. Same thing when doing computed, have not checked watchers but it is safe to assume that won't work either.

image

Reproducible Case

<template>
  <div>
    {{ getValue(value) }}
  </div>
</template>

<script type="ts">
import Vue, { PropType } from 'vue'

export default Vue.extend({
  props: {
    value: { type: String, default: '' },
  },
  data() {
    return {
      uppercased: this.getUpperCasedValue(),
    }
  },
  methods: {
    getUpperCasedValue() {
      return this.value.toUpperCase()
    },
    getValue() {
      return this.uppercased
    },
  }
})
</script>

padcom avatar May 04 '22 14:05 padcom

Having the same issue as well...

estevaoem avatar Aug 26 '22 18:08 estevaoem

Please check this guide. https://vuejs.github.io/vetur/guide/FAQ.html#property-xxx-does-not-exist-on-type-combinedvueinstance

yoyo930021 avatar Oct 04 '22 12:10 yoyo930021

does not work neither

stouch avatar Oct 11 '23 10:10 stouch