On my hands is a component structured like this:
@Component({
computed: {
[this.stateModel]: {
get() {
return this.$store[this.stateModel];
}
}
}
})
class Component extends Vue{
@Prop({ default: '' }) private stateModel!: string;
}
I want to bind stateModel
as a property while utilizing this component. This property should be a state field and needs to be injectable into the component. The issue arises when TypeScript throws an error stating:
Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
I attempted to create an interface and designate it as computed, but that approach failed to resolve the error.
Your assistance on this matter would be greatly appreciated.