<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { CustomerContext, getCustomerRepository } from '@/composables/customerRepository'
@Component
export default class CustomerList extends Vue {
search = ''
setup(): CustomerContext {
const ctx = getCustomerRepository()
return ctx
}
}
</script>
In Vue 2, I want to use the Composition API with the class component style by TypeScript, but I'm not sure I have the correct syntax. Also, the setup() function did not get invoked automatically.
Can vue-class-component work with the Compostion API in TypeScript?