Currently, I am in the process of creating a universal input Vue component. My main goal right now is to fetch the initial value from the store before focusing on manipulating the data within the input. Here's what I have so far:
This seems to be working well. However, instead of using the value
function in computed
, I wanted to utilize mapGetters
. When I attempted this approach, I encountered an issue where both values this.dataModel
and this.propertyName
returned undefined
. It seems that the context of this
changes when calling mapGetters
because we're inside a new object. Is there a way to pass component props into mapGetters
? Can we somehow set the context of this
to refer to the component itself rather than the object argument? Or should I stick with my original method or consider another approach to solve this problem?