vue.jsvisual-studio-codeveturgo-to-definition

Go To definition does not work in same file with VSCODE + VETUR


My vue.js configuration is

On follow code, "go definition" does not work with "could not find definition"

<template>
<div>
<button @click="clickEvent"/>
</div>
</template>

<script>
export default {
  ...
  methods: {
    clickEvent() {
      this.function1()
      ...
    },
    function1() {
      ...
    }
  }
  ...
}
</script>

Solution

  • vetur is look like no this function. Maybe you can try use vue-helper.

    enter image description here