1👍
✅
The Vue CLI docs state:
To let TypeScript properly infer types inside Vue component options, you need to define components with
Vue.component
orVue.extend
So, it should look similar to this:
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
data() {
return {
title: ''
}
},
methods: {
submitData() {
console.log(this.title)
}
}
})
</script>
Source:stackexchange.com