In my Vue project, I am using vue-class-component along with TypeScript. Within the project, I have a component and a Mixin set up as follows:
// MyComp.vue
import Component, { mixins } from 'vue-class-component'
import MyMixin from './mixin.ts'
@Component
export class MyComp extends mixins(MyMixin) {
compValue: string = 'Hello';
}
// mixin.ts
import Vue from 'vue'
import Component from 'vue-class-component'
@Component
export default class MyMixin extends Vue {
created() {
console.log(this.compValue); // TS2339: Property 'compValue' does not exist on type 'MyMixin'.
}
}
Everything is functioning correctly, but TypeScript is throwing an error regarding the missing property 'compValue'. How can I resolve this issue?