I have set up my development environment using Visual Studio Code, Vue 2 (webpack template), and Typescript.
Below is the code snippet for my App.vue component:
<template>
<div id="app">
<navbar></navbar>
[content here]
</div>
</template>
<script lang="ts">
import Navbar from './components/Navbar'
export default {
components: {
Navbar
}
}
</script>
Question 1: Everything is functioning correctly, but I am looking to enable intellisense within the <script lang="ts">
tag similar to .ts files. How can this be accomplished?
Question 2: In my main.ts file, I use import App from './App'
. However, VS Code highlights "./App" in red as it cannot locate the .ts file. Is there a way to make the editor recognize .vue files before compilation (during editing)?
Update (2018-03-25): For those interested in setting up Typescript in a Vue project, I highly recommend reading this article.