I'm using Visual Studio Code, Vue 2 (webpack template) and Typescript.
This is 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 working fine, but I would like to have intellisense inside <script lang="ts">
tag as it happens in .ts files, so how can I achieve that?
Question 2: In my main.ts I have import App from './App'
, but "./App" is underlined in red since VS Code can't find the .ts file. Is there a way to make the editor recognizes .vue before compile time (in editing time)?
Update (2018-03-25): I highly recommend everyone who wants to setup typescript to read this
import {default as Question} from './Question.vue'
" – TSV