I recently made the switch from Vue.js to TypeScript, but now I am facing an issue with using mixins in TypeScript. I tried two different types of mixins, but unfortunately, none of them worked for me and I keep getting error ts2339. I couldn't find a solution on https://v2.vuejs.org/v2/guide/typescript.html#Basic-Usage.
Here is the first mixin:
//mixin.ts
import {ViewState} from "@/types";
import {mocked_view_state} from "@/api/mock/profile.device.group.mock";
export const ProfileDeviceGroup = {
methods: {
resetViewState(): ViewState {
return mocked_view_state;
}
}
};
And here is the second one:
//mixin.ts
import Vue from "vue";
import {ViewState} from "@/types";
import {mocked_view_state} from "@/api/mock/profile.device.group.mock";
const ProfileDeviceGroup = Vue.extend({
methods: {
resetViewState(): ViewState {
return mocked_view_state;
},
}
});
export default ProfileDeviceGroup;
So, does anyone have any suggestions on how to resolve this problem?
..............
Update:
..............
After trying out vue-typed-mixins, the initial problem was resolved. However, a new issue has emerged as shown in the image below: https://i.sstatic.net/3tKJ8.png