vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

Intellisense for vuejs plugin don't work in .vue (Found a working tsconfig.json configuration) #1869

Open deguich opened 4 years ago

deguich commented 4 years ago

Info

Problem

No intellisense in .vue files for vuejs plugins like vue-router.

Reproductible Case

Tests projects

from scratch (tested with vue-cli project too)

In a testisense directory

yarn init -y
yarn add vue vue-router

File src/App.vue :

<script>
export default {
    methods: {
        test() {
        }
    }
}
</script>

No intellisense for vuejs plugin.

1_App_method

Working test

Add this tsconfig.json file at project root :

{
  "include": [
    "./node_modules/vue-router/types/index.d.ts"
  ]
}

Need restarting VSCode.

1_App_methodOK

octref commented 4 years ago

We could likely fix this by appending vue-router into include if found in package.json.