I created a project with vue-cli3 and included TypeScript
My src/app.vue:
<template>
<div id="app">
<hello-world msg="test"/>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from '@/components/HelloWorld';
@Component({
components: { HelloWorld },
})
export default class App extends Vue {}
</script>
the compiler throwing an error in "Cannot find module '@/components/HelloWorld'";
The component HelloWorld exists.
However, if I remove the lang="ts"
or add the .vue
extension then everything compiles fine. In my tsconfig.json, i have
"paths": {
"@/*": [ "src/*" ]
},
Is it an issue with tsconfig.json
or something else?