I have a component that looks like this:
@Component({
computed: {
[this.stateModel]: {
get() {
return this.$store[this.stateModel];
}
}
}
})
class Component extends Vue{
@Prop({ default: '' }) private stateModel!: string;
}
Which I'm trying is bind stateModel as a property when I use this component. stateModel should be a field in the state and could be injected into the component. Typescript is throwing me an error that said:
Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
I tried to make an Interface and set it as computed, but it didn't work.
Any help is highly appreciate it.
stateModelis a prop, are you trying to update the value of stateModel with that from the store when stateModel prop changes?stateModelof the state<Component :stateModel="foo">, foo should be in the state.