简体   繁体   中英

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

My vue.js configuration is

  • vue.js 2.0
  • use vue.cli
  • webpack
  • javascript not typescript
  • use multiple root
    • server: server project
    • client/dashboard: web client project(this is vue project)

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>
  • when go to definition on @click="clickEvent"
  • when go to definition on this.function1()
  • computed, props is same

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

在此处输入图像描述

You can try this extension: js-jumper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM