Vue3 / typescript accessing properties

Solution 1:

To enable type inference in components, use the defineComponent wrapper around the component declaration:

<script lang="ts">
import { defineComponent } from 'vue'
                     šŸ‘‡
export default defineComponent({
   created() {
     // šŸ’” type inference enabled
   }
})
</script>