[Vuejs]-Access vue component getter in tupescript mixin error (TS2339)

0👍

Try defining it here

import {Component, Vue} from 'vue-property-decorator';

@Component({})
export default class MyMixin extends Vue {

activeTab: any;
scrollToTop(): void {
        let scrollingWrapper: any = (this.$refs[**this.activeTab**] as Vue).$refs['scrolling-wrapper'];
        ...
    }
}

0👍

It is a poor solution, but i’m not able to find another. Casted this to any before method call.

let scrollingWrapper: any = (this.$refs[(this as any).activeTab] as Vue).$refs['scrolling-wrapper'];

Thanks to everyone.

Leave a comment