componentA.vue:
<script lang="ts">
import { Vue } from 'vue-property-decorator'
@Component
export default class ComponentA extends Vue {
public methodA(): void {
//
}
}
</script>
componentB.vue:
<template>
<component-a ref="aComponent" />
</template>
<script lang="ts">
import { Vue } from 'vue-property-decorator'
import ComponentA from './componentA.vue'
export default ComponentB extends Vue {
public initiate (): void {
(this.$refs.aComponent as typeof ComponentA).methodA()
}
}
TSLint warning:
Property 'methodA' does not exist on type 'Component<DefaultData<never>, DefaultMethods<never>, DefaultComputed, DefaultProps>'.
Is there a way to have 'typeof ComponentA' recognized as the class ComponentA without creating an additional interface?